diff options
| author | Warlaan | 2016-06-04 10:06:42 +0200 |
|---|---|---|
| committer | Rémi Verschelde | 2016-06-05 00:01:29 +0200 |
| commit | c6ef223498e112bbce73e6cdf3db7de29a93e416 (patch) | |
| tree | 4802ee607d8ff0d7bf346b410ab5c8759d6d0010 /tools/editor/create_dialog.cpp | |
| parent | 8a7c4c017f4ee44b15ea5caa6fed81408f3f2f07 (diff) | |
| download | godot-c6ef223498e112bbce73e6cdf3db7de29a93e416.tar.gz godot-c6ef223498e112bbce73e6cdf3db7de29a93e416.tar.zst godot-c6ef223498e112bbce73e6cdf3db7de29a93e416.zip | |
The create dialog starts collapsed now.
The original behavior can be reactivated in the editor settings.
(cherry picked from commit 987192775a713c61bc7ac17b54b3bbd1d1e067f3)
Diffstat (limited to 'tools/editor/create_dialog.cpp')
| -rw-r--r-- | tools/editor/create_dialog.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp index 060998c19..47411f0cd 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); |
