diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-04-16 10:09:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-16 10:09:37 +0200 |
commit | 192d176d30c3ad6d9e5c976b49b30d7349f2b5af (patch) | |
tree | 42ddaa7c83702a809b4dfacf62746b6c16817e2d /editor/scene_tree_editor.cpp | |
parent | 3069095e44d129058f0f4b5e48f81cbbe1bbaf04 (diff) | |
parent | 75bbd8259ab494f9f22bde057b27bb6500433f38 (diff) |
Merge pull request #28071 from YeldhamDev/treedialog_style_fix
Fix styling in 'SceneTreeDialog'
Diffstat (limited to 'editor/scene_tree_editor.cpp')
-rw-r--r-- | editor/scene_tree_editor.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 42272d0e6e..f2d11c2753 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -1121,22 +1121,17 @@ SceneTreeEditor::~SceneTreeEditor() { void SceneTreeDialog::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE) { - connect("confirmed", this, "_select"); - } - - if (p_what == NOTIFICATION_EXIT_TREE) { - disconnect("confirmed", this, "_select"); - } - if (p_what == NOTIFICATION_DRAW) { - - RID ci = get_canvas_item(); - get_stylebox("panel", "PopupMenu")->draw(ci, Rect2(Point2(), get_size())); - } - - if (p_what == NOTIFICATION_VISIBILITY_CHANGED && is_visible_in_tree()) { - - tree->update_tree(); + switch (p_what) { + case NOTIFICATION_ENTER_TREE: { + connect("confirmed", this, "_select"); + } break; + case NOTIFICATION_EXIT_TREE: { + disconnect("confirmed", this, "_select"); + } break; + case NOTIFICATION_VISIBILITY_CHANGED: { + if (is_visible_in_tree()) + tree->update_tree(); + } break; } } @@ -1165,8 +1160,6 @@ SceneTreeDialog::SceneTreeDialog() { tree = memnew(SceneTreeEditor(false, false, true)); add_child(tree); - //set_child_rect(tree); - tree->get_scene_tree()->connect("item_activated", this, "_select"); } |