On Mon, 27 Jan 2025 22:57:37 GMT, Michael Strauß <mstra...@openjdk.org> wrote:

>> Implementation of 
>> [`EXTENDED`](https://gist.github.com/mstr2/0befc541ee7297b6db2865cc5e4dbd09) 
>> and `EXTENDED_UTILITY` stage style.
>
> Michael Strauß has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   hide default window buttons on macOS

Some people have suggested that they not only need to customize the title bar, 
but also the window buttons. This is now possible with the latest version of 
this feature. 

The API is now designed with an on-ramp to customization:
1. Choosing the `StageStyle.EXTENDED` or `StageStyle.EXTENDED_UTILITY` gets you 
the custom title bar area with platform-default window buttons.
2. Setting `Stage.initDefaultHeaderButtons(false)` opts out of the 
platform-default window buttons, which then need to be provided by the 
application.

A custom window button is just a regular JavaFX button that can be placed 
anywhere in the scene graph. It needs to be marked with 
`HeaderBarBase.setHeaderButtonType(Node, HeaderButtonType)` to enable 
integrations with the platform window manager, where `HeaderButtonType` is 
`MINIMIZE`, `MAXIMIZE`, or `CLOSE`.

Applications are still required to provide their own click handlers to 
programmatically trigger the actions associated with window buttons, i.e. call 
appropriate stage methods like `Stage.setIconified(boolean)`, 
`Stage.setMaximized(boolean)` or `Stage.close()`.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1605#issuecomment-2617118769

Reply via email to