RFR: 8340344: The first item in TreeView is not aligned in the beginning [v5]

Ambarish Rapte arapte at openjdk.org
Wed May 14 14:31:03 UTC 2025


On Wed, 14 May 2025 14:02:06 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

>> Ziad El Midaoui has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update TreeCellSkin.java
>
> modules/javafx.controls/src/main/java/javafx/scene/control/skin/TreeCellSkin.java line 232:
> 
>> 230:                                 cell.layout();
>> 231:                             }
>> 232:                         }
> 
> This would perform a layout of all cells, re-layout of previous cells and layout of next cells.
> but, layout of next cells is performed again as continuation layout of TreeView.
> A solution would be to break the loop when `cell` is current cell being layouted, so that at least the layout of next cells is not performed twice.
> 
> Can there be a way to avoid re-layout of previous cells, too ? 🤔

Also noticed a scenario: When a TreeCell with disclosureNode is currently not shown on screen but becomes visible on scrolling. In that case the TreeCells are layout while the scroll is in progress. I see only one way to avoid this that maxDisclosureWidthMap should reflect the correct value before starting the layout.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1715#discussion_r2089090790


More information about the openjfx-dev mailing list