RFR: 8351047: TitledPane should handle titles that are resizable [v2]

John Hendrikx jhendrikx at openjdk.org
Sat Mar 29 09:10:51 UTC 2025


> This PR will forward more Label calculations to LabeledSkinBase, as they are quite complex, especially when a Graphic is involved which is a full-fledged `Node`. More specifically, this solves issues with TitledPane when the graphic is resizable (ie. an HBox is placed as Graphic in the titled pane's title area).  Before, the calculations would only look at the preferred size of the graphic, and use these regardless of available space, even if the maximum size allowed for the graphic to be larger. After this fix, the more extensive LabeledSkinBase calculations are used.
> 
> This PR also simplifies the layout calculation.  Instead of manually calculating where the label should be positioned (according to alignment), this is left to `layoutLabelInArea` which will do this automatically when its provided with the available space for the label instead of the label's width.
> 
> See the ticket for a sample program; take a look at the graphic-only case where an HBox is used to put a label + gap + button as the graphic of the titled pane.

John Hendrikx has updated the pull request incrementally with one additional commit since the last revision:

  Review comments

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

Changes:
  - all: https://git.openjdk.org/jfx/pull/1742/files
  - new: https://git.openjdk.org/jfx/pull/1742/files/b65002ac..1c5c50a9

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jfx&pr=1742&range=01
 - incr: https://webrevs.openjdk.org/?repo=jfx&pr=1742&range=00-01

  Stats: 3 lines in 1 file changed: 0 ins; 2 del; 1 mod
  Patch: https://git.openjdk.org/jfx/pull/1742.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1742/head:pull/1742

PR: https://git.openjdk.org/jfx/pull/1742


More information about the openjfx-dev mailing list