summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-06-04 10:29:58 +0200
committerRémi Verschelde <remi@verschelde.fr>2016-06-04 10:29:58 +0200
commitf32f4671542839495c5fbf18f3460eae8d0499f2 (patch)
tree97daead36d2fbba50495e07e3a3030f8282b1639
parent26332479d3d1df0b9c48288eedde9b2d85b3f752 (diff)
parent987192775a713c61bc7ac17b54b3bbd1d1e067f3 (diff)
Merge pull request #4994 from Warlaan/create_dialog_starts_collapsed
The create node dialog now starts collapsed.
-rw-r--r--tools/editor/create_dialog.cpp13
-rw-r--r--tools/editor/editor_settings.cpp1
2 files changed, 14 insertions, 0 deletions
diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp
index cd34b5aeb9..b6137ddac0 100644
--- a/tools/editor/create_dialog.cpp
+++ b/tools/editor/create_dialog.cpp
@@ -36,6 +36,7 @@
#if 1
#include "os/keyboard.h"
+#include "editor_settings.h"
#include "editor_help.h"
@@ -108,6 +109,18 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty
}
+ if (bool(EditorSettings::get_singleton()->get("scenetree_editor/start_create_dialog_fully_expanded"))) {
+ item->set_collapsed(false);
+ } else {
+ // don't collapse search results
+ bool collapse = (search_box->get_text() == "");
+ // don't collapse the root node
+ collapse &= (item != p_root);
+ // don't collapse abstract nodes on the first tree level
+ collapse &= ((parent != p_root) || (ObjectTypeDB::can_instance(p_type)));
+ item->set_collapsed(collapse);
+ }
+
const String& description = EditorHelp::get_doc_data()->class_list[p_type].brief_description;
item->set_tooltip(0,description);
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index 1080509b8f..93b3369aaf 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -493,6 +493,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("scenetree_editor/duplicate_node_name_num_separator",0);
hints["scenetree_editor/duplicate_node_name_num_separator"]=PropertyInfo(Variant::INT,"scenetree_editor/duplicate_node_name_num_separator",PROPERTY_HINT_ENUM, "None,Space,Underscore,Dash");
//set("scenetree_editor/display_old_action_buttons",false);
+ set("scenetree_editor/start_create_dialog_fully_expanded",false);
set("gridmap_editor/pick_distance", 5000.0);