summaryrefslogtreecommitdiff
path: root/tools/editor/scene_tree_editor.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2016-12-08 07:45:31 +0100
committerGitHub <noreply@github.com>2016-12-08 07:45:31 +0100
commite7cab423c2ed53eaa58b3cd189d54ee5df95ba1f (patch)
tree2a07f63fbb64c7af4fa723180e6688094b626b29 /tools/editor/scene_tree_editor.cpp
parentedddee5d45f4493de2d1fe456bfb435df748dcae (diff)
parenta192e0785ebe2942038dd75f3eafd4c8d34394ac (diff)
Merge pull request #7229 from volzhs/show-selected-node
Show selected node in Scene dock when parent node is folded
Diffstat (limited to 'tools/editor/scene_tree_editor.cpp')
-rw-r--r--tools/editor/scene_tree_editor.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index f5628d0c8f..ebfa62528f 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -725,6 +725,12 @@ void SceneTreeEditor::set_selected(Node *p_node,bool p_emit_selected) {
TreeItem* item=p_node?_find(tree->get_root(),p_node->get_path()):NULL;
if (item) {
+ // make visible when it's collapsed
+ TreeItem* node=item->get_parent();
+ while (node && node!=tree->get_root()) {
+ node->set_collapsed(false);
+ node=node->get_parent();
+ }
item->select(0);
item->set_as_cursor(0);
selected=p_node;