diff options
author | jmb462 <jmb462@gmail.com> | 2022-03-05 20:23:53 +0100 |
---|---|---|
committer | Jean-Michel Bernard <jmb462@gmail.com> | 2022-03-05 20:26:56 +0100 |
commit | ca2b7c59c08cdd3b6932207f737e42de4ba17aae (patch) | |
tree | 250724e1ed24126ff007b50c135c6d1b230984e7 /scene | |
parent | ff65d33e8c278bfbbbad18f9db959b2bbe04f919 (diff) |
Fix disabled tab can be enabled via rearranging inside TabContainer
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/tab_container.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 0d5165dbd8..65a258776b 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); + } } } } |