RFR: 8370446: Support dialogs with StageStyle.EXTENDED [v4]
Michael Strauß
mstrauss at openjdk.org
Thu Nov 13 10:12:33 UTC 2025
On Thu, 13 Nov 2025 09:58:29 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:
>> Adds the `DialogPane.headerBar` property, which allows developers to specify a custom `HeaderBar` when the dialog uses the `EXTENDED` stage style.
>
> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
>
> fix incorrect button metrics
I discovered a bug where `HeaderBar` would sometimes not report its correct height in situations when a `DialogPane` is re-used (similar to [this](https://github.com/openjdk/jfx/pull/1943#issuecomment-3440326580)). The root cause for this bug was that `HeaderButtonOverlay.metricsProperty()` was updated in `HeaderButtonOverlay.layoutChildren()`, i.e. during the layout phase. However, the metrics property itself is used as an input for the layout of `HeaderBar`, so its value should be known in advance of layout, and not be determined during the layout phase. The solution here is to disentangle the computation of header button metrics from the layout computation of `HeaderButtonOverlay`. I've refactored the code a bit, and now the `metrics` property is always updated after CSS processing (which is when we have enough information to know the size and placement of the header buttons), and therefore _before_ a layout pass.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1943#issuecomment-3526950507
More information about the openjfx-dev
mailing list