Merge pull request #63518 from timothyqiu/window-toggle
This commit is contained in:
commit
db523dd400
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user