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 TabBar initialization issue and add tests #97255

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

kitbdev
Copy link
Contributor

@kitbdev kitbdev commented Sep 20, 2024

Fixed TabContainer emitting multiple signals when being added to the tree if a child was made visible (for the children visibility before entering tree test).

Adds tests for TabBar and TabContainer.
Includes basic tests for adding and removing tabs, setting current tab, adding tabs when out of tree (important for initialization), and some layout tests.
This should help prevent regressions.
If there is too much, I can separate it into another PR.

TabBar and TabContainer both have a similar system to allow setting the current_tab before adding tabs, it might be possible to combine them in the future.

I had to make a public set_tab_offset since there was no other way to set the tab offset other than sending a mouse click to the offset buttons, ensure_tab_visible doesn't offer enough control. We should consider exposing it in the future.

Also added a debug message for if SIGNAL_CHECK_FALSE fails, it now says what the actual arguments are, just like SIGNAL_CHECK.

@AThousandShips AThousandShips added bug regression topic:gui cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Sep 21, 2024
@AThousandShips AThousandShips added this to the 4.4 milestone Sep 21, 2024
Copy link
Member

@YeldhamDev YeldhamDev left a comment

Choose a reason for hiding this comment

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

LGTM.

@akien-mga akien-mga merged commit 2d8bfab into godotengine:master Oct 4, 2024
19 checks passed
@akien-mga
Copy link
Member

Thanks!

@kitbdev kitbdev deleted the test-tabs branch October 4, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release regression topic:gui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TabBar current tab not set correctly from previous version
4 participants