Add visibilty mode to as_sortable_control()

This commit is contained in:
kobewi
2024-06-02 00:33:28 +02:00
parent 5f1184e93f
commit 02e1e6d1ec
9 changed files with 35 additions and 23 deletions

View File

@@ -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;
}