RFR: 8231644: TreeTableView Regression: Indentation wrong using Label as column content type [v3]

Marius Hanl mhanl at openjdk.java.net
Fri Sep 24 16:35:33 UTC 2021

On Fri, 24 Sep 2021 10:43:31 GMT, Ajit Ghaisas <aghaisas at openjdk.org> wrote:

>> Marius Hanl has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
>>  - Merge branch 'master' of https://github.com/openjdk/jfx into 8231644-indentation
>>     Conflicts:
>>    	modules/javafx.controls/src/main/java/javafx/scene/control/skin/TreeTableCellSkin.java
>>  - calculated indentation in every method now which was previously done via leftLabelPadding
>>  - 8231644: fixed wrong indentation for tree cells with graphic only
> modules/javafx.controls/src/main/java/javafx/scene/control/skin/TreeTableCellSkin.java line 127:
>> 125:             double leftInset) {
>> 126:         if (isDeferToParentForPrefWidth) {
>> 127:             return super.computePrefWidth(height, topInset, rightInset, bottomInset, leftInset) + calculateIndentation();
> If we are deferring to Parent for the preferred width, then we need not add indentation. 
> I think, we should interchange line 127 and line 130.

No that's actually correct as it is. 

That is because when a cell is deferred from the parent we want to know the width we need without being truncated. For now that is only set when the auto size of the table is triggered (see also: **TableColumnHeader#resizeColumnToFitContent**). 

And if not deferred, the width of the cell is in sync with the column (you can also see it in the **super.computePrefWidth**)


PR: https://git.openjdk.java.net/jfx/pull/568

More information about the openjfx-dev mailing list