diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-08 16:13:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-08 16:13:30 +0200 |
commit | db523dd4001b9b1c0ec6c2ca844f730cb072ada2 (patch) | |
tree | 303b66cdff4426aa0d7a9e6d95bd2b4cc51deb5b /editor | |
parent | 557c16bb88161e5fc86cffe020cd1c28f78067e7 (diff) | |
parent | 42373df2d4a7c7d33ab72b73efe7b01bf43bb609 (diff) |
Merge pull request #63518 from timothyqiu/window-toggle
Diffstat (limited to 'editor')
-rw-r--r-- | editor/scene_tree_editor.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 282cfa80e8..ad83db9b60 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -400,7 +400,7 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { } _update_visibility_color(p_node, item); - } else if (p_node->is_class("CanvasLayer")) { + } else if (p_node->is_class("CanvasLayer") || p_node->is_class("Window")) { bool v = p_node->call("is_visible"); if (v) { item->add_button(0, get_theme_icon(SNAME("GuiVisibilityVisible"), SNAME("EditorIcons")), BUTTON_VISIBILITY, false, TTR("Toggle Visibility")); @@ -490,10 +490,7 @@ void SceneTreeEditor::_node_visibility_changed(Node *p_node) { bool visible = false; - if (p_node->is_class("CanvasItem")) { - visible = p_node->call("is_visible"); - CanvasItemEditor::get_singleton()->get_viewport_control()->update(); - } else if (p_node->is_class("CanvasLayer")) { + if (p_node->is_class("CanvasItem") || p_node->is_class("CanvasLayer") || p_node->is_class("Window")) { visible = p_node->call("is_visible"); CanvasItemEditor::get_singleton()->get_viewport_control()->update(); } else if (p_node->is_class("Node3D")) { @@ -539,7 +536,7 @@ void SceneTreeEditor::_node_removed(Node *p_node) { p_node->disconnect("script_changed", callable_mp(this, &SceneTreeEditor::_node_script_changed)); } - if (p_node->is_class("Node3D") || p_node->is_class("CanvasItem") || p_node->is_class("CanvasLayer")) { + if (p_node->is_class("Node3D") || p_node->is_class("CanvasItem") || p_node->is_class("CanvasLayer") || p_node->is_class("Window")) { if (p_node->is_connected("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed))) { p_node->disconnect("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed)); } |