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

Fix tab closing when trying to select partly clipped tab. #6164

Merged
merged 2 commits into from
Jul 10, 2023

Conversation

neilcsmith-net
Copy link
Member

Fix FlatEditorTabCellRenderer to not return close button bounds when clipped and not painting it. This seems to be the cause of #4738 and #6143

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.

Looks good, assuming you tested it before and after and confirmed that the bug was reproducible first and then disappeared once the patch was put in.

Thanks for fixing this! (I do see that bug in my own IDE!)

@neilcsmith-net
Copy link
Member Author

Thanks @eirikbakke yes, of course. 😄 And stepped through with the debugger to see what was going on before and after the change. Been annoying me for a little while too.

@eirikbakke
Copy link
Contributor

Yeah, I was just too lazy to build and test it myself :-)

Copy link
Member

@DevCharly DevCharly left a comment

Choose a reason for hiding this comment

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

Just tested. Fixes the issues for FlatLaf 👍

The same fix is needed for the Windows L&F here:

Also tested Nimbus and Metal, but they do not have the issue because they use different painters for clipped sided, which always return zero-size rectangle from TabPainter.getCloseButtonRectangle(). E.g. in class NimbusLeftClipPainter.

Aqua, GTK, WinVista, WinClassic and WinXP also have such painters for clipped sides.

@neilcsmith-net neilcsmith-net added the ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) label Jul 10, 2023
@neilcsmith-net
Copy link
Member Author

@DevCharly thanks, OK, done. I hadn't looked at any of the other implementations.

My main dev machine doesn't run Windows, and I might not be able to test there this week. I've added the ci:dev-build label. Could someone double check this is all good there before merge? Thanks!

@mbien
Copy link
Member

mbien commented Jul 10, 2023

this issue shows that not enough use the "group by project" setting :D
I was always confused by the issues since I couldn't reproduce this no matter how many pixels the button had on screen.

@DevCharly
Copy link
Member

@mbien maybe you have enabled one of the options in following screenshot that are surrounded by red rectangles?
Then you're using multi-tabs implementation, which does not have this issue.
NetBeans has two implementations for tabs:

  • tab control: only single-line on top edge (the default)
  • multi-tabs: multi-line, top/bottom/left/right edges, ...

image

@mbien
Copy link
Member

mbien commented Jul 10, 2023

@DevCharly yes exactly. I have usually the bottom right checkbox enabled since I typically have many projects open at the same time.

Copy link
Member

@DevCharly DevCharly left a comment

Choose a reason for hiding this comment

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

Tested Windows L&F. Works 👍

@neilcsmith-net
Copy link
Member Author

Thanks, merging.

@neilcsmith-net neilcsmith-net merged commit 68be4fc into apache:master Jul 10, 2023
@neilcsmith-net neilcsmith-net deleted the flatlaf-tab-close branch January 16, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Look and Feel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tab close button placement flatlaf l&f Tab's Close button not showing on partially hidden left tab
4 participants