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

Using the size of the tabs as minimum size. #3712

Merged

Conversation

George-Devel
Copy link

@George-Devel George-Devel commented Mar 5, 2022

See Netbeans issue #3710

@George-Devel
Copy link
Author

Hi, my code change may look weird, but this component is responsible for drawing the tab-bar in the editor area. This is only the part of the "North" component of a border layout. The minimum size of the actual content is the "Center" component and is considered by the panel.

You can check, that this works correctly by trying the Platform Application attached to the bug.
It contains only one relevant file: an editor window, registered with annotations, with a minimum size set and an overridden paint method to show the minimum size. If you like I can this file separately.

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.

I agree that BasicScrollingTabDisplayerUI.getMinimumSize() should return only the minimum size of the tabs.
Currently it returns the the minimum size of the tabs plus the minimum size of the tab content.
getPreferredSize() in BasicScrollingTabDisplayerUI subclasses also return only preferred size of the tabs.

For some unknown reason, this was added in 2008 in commit: emilianbold/netbeans-releases@82a48e9#diff-2f04bb43144858669541be39da8de41c29eef37380e8a2b3ce26dce479c92534
This is the related issue: https://bz.apache.org/netbeans/show_bug.cgi?id=136636

Don't understand the need for this BasicScrollingTabDisplayerUI.getMinimumSize() implementation. Maybe some part of the windowing system worked different in 2008 that it does today...

There is a similar getMinimumSize() method in AbstractViewTabDisplayerUI, which was added in the same commit:
emilianbold/netbeans-releases@82a48e9#diff-c2ceef123f96cb6d9bbb42f06afa4cdc636d72746b85139890a4774e6caddac2

Maybe this also needs to be changed? But maybe only if isUseStretchingTabs() returns true.

@George-Devel
Copy link
Author

@DevCharly - I changed the line as requested. I also replaced 'getMinimumSize()' in AbstractViewTabDisplayerUI with the same code. I checked the 'BasicScrollingTabDisplayerUI' in the Editor area, and AbstractViewTabDisplayerUI in the output area ,including the variant with "winsys.stretching_view_tabs" set to true.

My assumption that the AbstractViewTabDisplayerUI is used if "Multi-row tabs" was wrong. This another independent issue.

@DevCharly DevCharly added this to the NB14 milestone Apr 16, 2022
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.

Thanks for reviewing, @DevCharly! The change sound fine with me... I'll test this in my IDE and NetBeans Platform application the next time I do a build, but no need to wait for that.

@lkishalmi lkishalmi merged commit e67baa3 into apache:master Apr 19, 2022
@lkishalmi
Copy link
Contributor

Well, it is approved. Let's merge it then!
Thank you @George-Devel for your contribution!

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

Successfully merging this pull request may close these issues.

Editor Windows require twice the minimum height of the content (caused by BasicScrollingTabDisplayerUI)
4 participants