RFR: 8328577: Toolbar's overflow button overlaps the items [v5]

Andy Goryachev angorya at openjdk.org
Mon Apr 15 15:57:00 UTC 2024


On Mon, 15 Apr 2024 15:42:27 GMT, eduardsdv <duke at openjdk.org> wrote:

>> modules/javafx.controls/src/main/java/javafx/scene/control/skin/ToolBarSkin.java line 575:
>> 
>>> 573:         box.getStyleClass().addListener((ListChangeListener<? super String>) change -> overflowBox.getStyleClass().setAll(change.getList()));
>>> 574:         overflowBox.getStylesheets().setAll(box.getStylesheets());
>>> 575:         box.getStylesheets().addListener((ListChangeListener<? super String>) change -> overflowBox.getStylesheets().setAll(change.getList()));
>> 
>> this is interesting.  
>> 
>> isn't `overflowBox` a sibling of `box`, having the same parent, and therefore inheriting the same set of stylesheets from the parent `Scene`?
>
> In addition to those from the scene, each ``Parent`` can have its own stylesheets.

OK, you are correct - the `box` is technically visible via node lookup by the "content" style, so the app developer can attach a stylesheet to it (why they would do it is another question, I am sure there are many other places where doing so would break the code).
And we are not creating leaks because both nodes are siblings.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1434#discussion_r1566017946


More information about the openjfx-dev mailing list