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

FlatLaf: fix location of drag-and-drop insert indicator lines #6142

Merged
merged 1 commit into from
Jul 2, 2023

Conversation

DevCharly
Copy link
Member

When doing drag-and-drop in tree, tree-table or palette, then the insert indicator lines are painted at wrong location in NB 18 on Windows 10/11 with FlatLaf.

image

(red arrow indicates the correct location where the dnd lines should be painted)

The reason for this problem is that since FlatLaf 3.1 (since NB 18), glass panes are not located at location 0,0 in root pane (if FlatLaf window decorations are enabled). But NetBeans code converts locations to root pane coordinates and uses them to paint on glass pane, which is not located at 0,0 in root pane.

This PR fixes the problem for TreeView, OutlineView (e.g. used in "Search Result" view) and palette.

I've searched the NB source code for getRootPane, convertPoint and convertRectangle and checked results whether coordinate conversion is used for glass panes. Found only the 3 files fixed in this PR.

Fixes #6134

…ows 10/11, which was wrong since updating to FlatLaf 3.1 in NB 18 because because FlatLaf places glass panes no longer at 0,0 if FlatLaf window decorations are enabled
Copy link
Contributor

@eirikbakke eirikbakke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works in my private IDE build! Thanks for this PR!

Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks sane to me and I fixes a real irritating issue.

@DevCharly DevCharly merged commit 3fe7814 into apache:master Jul 2, 2023
@DevCharly DevCharly deleted the dnd-line-location-fix branch July 2, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FormDesigner GUI builder, also known as Matisse UI User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

forms designer re-ordering components dragging gone weird
4 participants