Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The selected table cell's height of FlatTableUI when dragging the TableHeader #236

Closed
weimsh opened this issue Jan 13, 2021 · 4 comments
Closed
Milestone

Comments

@weimsh
Copy link

weimsh commented Jan 13, 2021

When I select one row in the Table and then select one column in the row(Now the column is focused or selected), then I start dragging the table header to change the column's order (or its index) to another, but find the selected cell's height is 1px less than the other columns' in the row.

Please Notice that My TableUI's settings are below:
Table.showHorizontalLines=true
Table.showVerticalLines=true

And the flatlaf's version is lastest 0.46.

snapshot

@DevCharly
Copy link
Collaborator

Thx for reporting. I can reproduce it.

@weimsh
Copy link
Author

weimsh commented Jan 14, 2021

Thanks!

DevCharly added a commit that referenced this issue Feb 12, 2021
@DevCharly
Copy link
Collaborator

Found the reason for the issue:
there is a horizontal grid line painted at the bottom of the selected dragged cell.

The problem is the order of painting:

  • for dragged column, the cells are painted before the grid is painted
    (so the grid is painted over the cell if Table.intercellSpacing is 0,0)
  • for non-dragged columns, the grid is painted before the cells are painted
    (so the cell paints selection over the grid)

This painting is done in private methods in BasicTableUI.
Can't do much here (at the moment).

As workaround you could use following:

UIManager.put( "Table.intercellSpacing", new Dimension( 0, 1 ) );

@DevCharly DevCharly added this to the 1.0 milestone Feb 12, 2021
@DevCharly
Copy link
Collaborator

BTW while working on this issue, I noticed wrong grid line painting in dragged column on HiDPI screens:

image

This is fixed in commit 4f00591

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants