On Wed, 17 Jun 2026 17:01:12 GMT, Michael Strauß <[email protected]> wrote:

>> JavaFX controls in the title bar were previewed with 
>> [JDK-8313424](https://bugs.openjdk.org/browse/JDK-8313424) (delivered in JFX 
>> 25) and the API was subsequently refined with 
>> [JDK-8369836](https://bugs.openjdk.org/browse/JDK-8369836) and 
>> [JDK-8370446](https://bugs.openjdk.org/browse/JDK-8370446) (delivered in JFX 
>> 26). The feedback collected in two preview rounds suggests that the API is 
>> fit for purpose, and no fundamental changes are required. This means that 
>> the feature is ready to become final and permanent in JFX 27.
>> 
>> I propose a few small changes to smooth out remaining edges:
>> 1. **Rename `HeaderBar.prefButtonHeight` to `HeaderBar.systemButtonHeight`**
>>    This more clearly expresses that it is the height of the 
>> _system-provided_ buttons.
>> 2. **Rename `HeaderBar.minSystemHeight` to `HeaderBar.systemMinHeight`**
>>    What is meant is not a _minimum system height_ (which makes no sense), 
>> but a _system-provided minimum height_.
>> 3. **Add `HeaderBar.systemColorScheme`**
>>    In the previous iteration, the color scheme of the header buttons on 
>> Windows and Linux was determined by the brightness of the `Scene.fill` 
>> background. On macOS, which uses header buttons drawn by the operating 
>> system, the color scheme of the header buttons was instead determined by the 
>> color scheme of the window itself.
>> 
>>    The newly added `HeaderBar.systemColorScheme` attached property allows 
>> applications to specify the color scheme for system-provided header buttons 
>> directly, without falling back to either the scene background or the window 
>> color scheme. The default value of the property is `null`, which means "no 
>> preference"; in this case, the color scheme for header buttons will match 
>> the color scheme for the window on all platforms. Setting this property to a 
>> non-null value is only necessary in the rare case when an application needs 
>> different color schemes for header buttons and the window (i.e. when it has 
>> a bright title bar in dark mode, or a dark title bar in light mode).
>> 
>> Since these changes are only cosmetic (in the case of renamed properties) 
>> and don't fundamentally change the API of the enhancement (in the case of 
>> `HeaderBar.systemColorScheme`), they shouldn't need to be previewed for 
>> another round.
>> 
>> The rest of the significant changes in this PR are a clean-up pass over the 
>> documentation, and having the macOS header button implementation support the 
>> new `HeaderBar.systemColorScheme` property.
>> 
>> ## Note on the use of attached properties
>> This e...
>
> Michael Strauß has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   change "since" javadoc tag to 27

preliminary code review, more tomorrow.

modules/javafx.graphics/src/main/java/com/sun/glass/ui/Window.java line 316:

> 314: 
> 315:     public final ReadOnlyDoubleProperty headerButtonHeightProperty() {
> 316:         return headerButtonHeight;

returns a `SimpleDoubleProperty` not `ReadOnlyDoubleProperty`

modules/javafx.graphics/src/main/java/com/sun/glass/ui/Window.java line 336:

> 334: 
> 335:     public final ReadOnlyBooleanProperty headerButtonDarkStyleProperty() 
> {
> 336:         return headerButtonDarkStyle;

returns not a `ReadOnlyBooleanProperty`

modules/javafx.graphics/src/main/java/javafx/scene/layout/HeaderBar.java line 
272:

> 270:      * Specifies the {@code HeaderButtonType} of the child, indicating 
> its semantic use in the header bar.
> 271:      * <p>
> 272:      * This property can be set on any {@link Node}. Specifying a {@code 
> HeaderButtonType} also provides the

provide a `{@link` instead of `{@code` perhaps?

modules/javafx.graphics/src/main/java/javafx/scene/layout/HeaderBar.java line 
370:

> 368:      */
> 369:     public static double getSystemButtonHeight(Stage stage) {
> 370:         return AttachedProperties.of(stage).systemButtonHeight.get();

side node: if we decide to put rarely used properties in a hashtable (see 
https://github.com/andy-goryachev-oracle/Test/blob/main/doc/Experiments/NodeProperties.md
 ) we could get rid of the `AttachedProperties` machinery (or roll it into the 
`NodeProperties`).

modules/javafx.graphics/src/main/java/javafx/stage/Stage.java line 99:

> 97:  * <li>{@link StageStyle#UTILITY} - a stage with a solid white background 
> and
> 98:  * minimal platform decorations.</li>
> 99:  * <li>{@link StageStyle#EXTENDED} - a decorated stage with a custom 
> {@link HeaderBar} (Preview Feature).</li>

rm Preview Feature

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

PR Review: https://git.openjdk.org/jfx/pull/2188#pullrequestreview-4519691391
PR Review Comment: https://git.openjdk.org/jfx/pull/2188#discussion_r3431514881
PR Review Comment: https://git.openjdk.org/jfx/pull/2188#discussion_r3431690436
PR Review Comment: https://git.openjdk.org/jfx/pull/2188#discussion_r3431706665
PR Review Comment: https://git.openjdk.org/jfx/pull/2188#discussion_r3431720348
PR Review Comment: https://git.openjdk.org/jfx/pull/2188#discussion_r3431525092

Reply via email to