diff options
Diffstat (limited to 'scene/gui/tab_container.cpp')
-rw-r--r-- | scene/gui/tab_container.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index d0c3f3d65e..58724cf4e9 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -362,8 +362,8 @@ void TabContainer::_on_mouse_exited() { Vector<Control *> TabContainer::_get_tab_controls() const { Vector<Control *> controls; for (int i = 0; i < get_child_count(); i++) { - Control *control = Object::cast_to<Control>(get_child(i)); - if (!control || control->is_set_as_top_level() || control == tab_bar || children_removing.has(control)) { + Control *control = as_sortable_control(get_child(i), SortableVisbilityMode::IGNORE); + if (!control || control == tab_bar || children_removing.has(control)) { continue; } @@ -539,8 +539,8 @@ void TabContainer::add_child_notify(Node *p_child) { return; } - Control *c = Object::cast_to<Control>(p_child); - if (!c || c->is_set_as_top_level()) { + Control *c = as_sortable_control(p_child, SortableVisbilityMode::IGNORE); + if (!c) { return; } c->hide(); @@ -569,8 +569,8 @@ void TabContainer::move_child_notify(Node *p_child) { return; } - Control *c = Object::cast_to<Control>(p_child); - if (c && !c->is_set_as_top_level()) { + Control *c = as_sortable_control(p_child, SortableVisbilityMode::IGNORE); + if (c) { tab_bar->move_tab(c->get_meta("_tab_index"), get_tab_idx_from_control(c)); } @@ -584,8 +584,8 @@ void TabContainer::remove_child_notify(Node *p_child) { return; } - Control *c = Object::cast_to<Control>(p_child); - if (!c || c->is_set_as_top_level()) { + Control *c = as_sortable_control(p_child, SortableVisbilityMode::IGNORE); + if (!c) { return; } |