RFR: 8340344: The first item in TreeView is not aligned in the beginning [v5]
Ambarish Rapte
arapte at openjdk.org
Wed May 14 14:05:00 UTC 2025
On Fri, 9 May 2025 10:51:20 GMT, Ziad El Midaoui <zelmidaoui at openjdk.org> wrote:
>> The issue occurred because items preceding an item with children (items with a disclosure node) had different widths, which led to misalignment. This can be fixed by requesting a cell relayout whenever the disclosure node's width changes.
>
> 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 ? 🤔
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1715#discussion_r2089032872
More information about the openjfx-dev
mailing list