From ca2b7c59c08cdd3b6932207f737e42de4ba17aae Mon Sep 17 00:00:00 2001 From: jmb462 Date: Sat, 5 Mar 2022 20:23:53 +0100 Subject: [PATCH] Fix disabled tab can be enabled via rearranging inside TabContainer --- scene/gui/tab_container.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 0d5165dbd82..65a258776b7 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -401,7 +401,10 @@ void TabContainer::_drop_data_fw(const Point2 &p_point, const Variant &p_data, C } move_child(get_tab_control(tab_from_id), get_tab_control(hover_now)->get_index(false)); - set_current_tab(hover_now); + if (!is_tab_disabled(hover_now)) { + set_current_tab(hover_now); + } + } else if (get_tabs_rearrange_group() != -1) { // Drag and drop between TabContainers. Node *from_node = get_node(from_path); @@ -416,8 +419,9 @@ void TabContainer::_drop_data_fw(const Point2 &p_point, const Variant &p_data, C } move_child(moving_tabc, get_tab_control(hover_now)->get_index(false)); - - set_current_tab(hover_now); + if (!is_tab_disabled(hover_now)) { + set_current_tab(hover_now); + } } } }