On Sat, 15 Nov 2025 02:00:41 GMT, Michael Strauß <[email protected]> wrote:

>> The `HeaderBar` control currently has three areas: `leading`, `center`, and 
>> `trailing`. Additionally, there's `leftSystemInset` and `rightSystemInset`, 
>> which are not RTL adjusted. I've come to the understanding that there is no 
>> particularly good reason for this, because every time you would want to use 
>> this information for layout purposes, it should also be adjusted for RTL.
>> 
>> With this in mind, there are three changes for the `HeaderBar` control:
>> 1. Rename `leading` to `left`, and `trailing` to `right`, which aligns the 
>> terminology with `BorderPane`.
>> 2. Adjust `leftSystemInset` and `rightSystemInset` for RTL.
>> 3. Make `leftSystemInset`, `rightSystemInset`, and `minSystemHeight` 
>> attached properties for `Stage`.
>> 
>> With this change, the `HeaderBar` control is more semantically consistent 
>> and easier to use, and the renamed `left` and `right` areas now show its 
>> close relationship with `BorderPane`.
>
> Michael Strauß has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains four additional 
> commits since the last revision:
> 
>  - documentation
>  - Merge branch 'master' into headerbar-update
>  - Make leftSystemInset/rightSystemInset/minSystemHeight attached properties
>  - Update HeaderBar API

modules/javafx.graphics/src/main/java/javafx/scene/layout/package-info.java 
line 208:

> 206:  * <p>
> 207:  * For layout containers, the layout orientation determines the visual 
> order of their children. If a layout container
> 208:  * has named areas, the names always retain their default meaning. For 
> example, the {@code left} and {@code right}

It might be just me, but I still find this explanation very confusing (what is 
the default meaning of left?).

Could we just say that for historical reasons, "left" and "right" in reality 
mean "leading" and "trailing", or maybe that in the RTL mode the left/right are 
swapped, with the "left" nodes appearing on the leading (visually right) side, 
and the "right" ones are on the trailing (visually left) side?

Also, do you think we should explicitly mention entities where this logic 
applies  (`BorderPane`, `HeaderBar`)?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1936#discussion_r2535367949

Reply via email to