1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Fix TabBar initialization issue and add tests

This commit is contained in:
kit
2024-09-20 15:40:55 -04:00
parent 2be730a05b
commit f2f34e9c50
7 changed files with 1557 additions and 6 deletions

View File

@@ -190,7 +190,7 @@ void TabContainer::_notification(int p_what) {
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
if (!is_visible() || setup_current_tab > -2) {
if (!is_visible()) {
return;
}
@@ -200,7 +200,7 @@ void TabContainer::_notification(int p_what) {
// beat it to the punch and make sure that the correct node is the only one visible first.
// Otherwise, it can prevent a tab change done right before this container was made visible.
Vector<Control *> controls = _get_tab_controls();
int current = get_current_tab();
int current = setup_current_tab > -2 ? setup_current_tab : get_current_tab();
for (int i = 0; i < controls.size(); i++) {
controls[i]->set_visible(i == current);
}