You've already forked godot
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user