RFR: JDK-8320444: Column drag header is positioned wrong for nested columns

Karthik P K kpk at openjdk.org
Tue Nov 21 13:50:22 UTC 2023


On Mon, 20 Nov 2023 22:24:58 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

> When a nested column is dragged, the column drag header (blue) is positioned wrong.
> It appears at the very left of the table and not where the column is.
> 
> ![image](https://github.com/openjdk/jfx/assets/66004280/6c2a0f61-f32d-4c38-9549-e2e20f5bd4f8)
> 
> The fix is to calculate the bound based off the `TableHeaderRow` (and not the parent `NestedTableColumnHeader`.

The changes look good to me. Tested the changes in MacOS.
Added minor comments inline.

modules/javafx.controls/src/test/java/test/javafx/scene/control/skin/TableViewSkinTest.java line 225:

> 223:         TableColumnHeaderShim.columnReordering(tableColumnHeader, bounds.getMinX() + 20, bounds.getMinY());
> 224: 
> 225:         // 200, since we have 2 columns to the left with a size of 100.

Can you also add why assertion is done for 220 in this comment?

modules/javafx.controls/src/test/java/test/javafx/scene/control/skin/TreeTableViewSkinTest.java line 205:

> 203:         TableColumnHeaderShim.columnReordering(tableColumnHeader, bounds.getMinX() + 20, bounds.getMinY());
> 204: 
> 205:         // 200, since we have 2 columns to the left with a size of 100.

Same as the previous comment. Can you also add why assertion is done for 220 in this comment?

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

PR Review: https://git.openjdk.org/jfx/pull/1292#pullrequestreview-1742056783
PR Review Comment: https://git.openjdk.org/jfx/pull/1292#discussion_r1400620365
PR Review Comment: https://git.openjdk.org/jfx/pull/1292#discussion_r1400620856


More information about the openjfx-dev mailing list