From 8c6ede10c5e2d686fdac2fe0be19804d708438c0 Mon Sep 17 00:00:00 2001 From: ajreckof <66184050+ajreckof@users.noreply.github.com> Date: Thu, 8 Jun 2023 05:32:19 +0200 Subject: [PATCH] Prevent unselectable nodes when switching filter and no children match the new filter --- editor/gui/scene_tree_editor.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/editor/gui/scene_tree_editor.cpp b/editor/gui/scene_tree_editor.cpp index 76e09769cc5..622bad517e2 100644 --- a/editor/gui/scene_tree_editor.cpp +++ b/editor/gui/scene_tree_editor.cpp @@ -656,15 +656,13 @@ bool SceneTreeEditor::_update_filter(TreeItem *p_parent, bool p_scroll_to_select } } - if (keep_for_children) { - if (keep) { - p_parent->clear_custom_color(0); - p_parent->set_selectable(0, true); - } else { - p_parent->set_custom_color(0, get_theme_color(SNAME("disabled_font_color"), SNAME("Editor"))); - p_parent->set_selectable(0, false); - p_parent->deselect(0); - } + if (keep) { + p_parent->clear_custom_color(0); + p_parent->set_selectable(0, true); + } else if (keep_for_children) { + p_parent->set_custom_color(0, get_theme_color(SNAME("disabled_font_color"), SNAME("Editor"))); + p_parent->set_selectable(0, false); + p_parent->deselect(0); } if (editor_selection) {