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

Implement Tabs node minimum size #47491

Merged
merged 1 commit into from
Mar 30, 2021
Merged

Conversation

groud
Copy link
Member

@groud groud commented Mar 30, 2021

Fixes a long overdue 😛 TODO in the Tabs node.

This allow with the new "clip_tabs" property to set up a minimum size to the Tabs node. It's enabled by default to keep compatibility.

Also, I changed the logic a little bit used to choose when a tab should be shown or not. Previously, it always removed the size of the increment and decrement buttons from the available space, even if the last tab would fit in the parent's size. So now, it instead waits for the last bit of space available to show the buttons. (Not sure if there was an issue about that, but didn't find one)

To illustrate the changes:

Peek.30-03-2021.12-28.mp4

Bugsquad edit: This closes #31238.

@groud groud added this to the 4.0 milestone Mar 30, 2021
@groud groud requested a review from a team as a code owner March 30, 2021 10:30
scene/gui/tabs.cpp Outdated Show resolved Hide resolved
@groud groud marked this pull request as draft March 30, 2021 11:31
@groud groud marked this pull request as ready for review March 30, 2021 12:11
@groud
Copy link
Member Author

groud commented Mar 30, 2021

I had to add few other changes, to make sure the 2nd change in the PR (showing buttons only when needed) works properly.
For now I could not find any issues, it seems to work fine.

@KoBeWi
Copy link
Member

KoBeWi commented Mar 30, 2021

clip_tabs property needs doc description, everything else looks ok.

@groud
Copy link
Member Author

groud commented Mar 30, 2021

Done, I added the documentation.

@akien-mga akien-mga merged commit 69a78c0 into godotengine:master Mar 30, 2021
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

Tabs' set_min_width() doesn't seem to be effective
3 participants