The create dialog starts collapsed now.

The original behavior can be reactivated in the editor settings.

(cherry picked from commit 987192775a)
This commit is contained in:
Warlaan 2016-06-04 10:06:42 +02:00 committed by Rémi Verschelde
parent 8a7c4c017f
commit c6ef223498
2 changed files with 14 additions and 0 deletions

View File

@ -36,6 +36,7 @@
#if 1 #if 1
#include "os/keyboard.h" #include "os/keyboard.h"
#include "editor_settings.h"
#include "editor_help.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; const String& description = EditorHelp::get_doc_data()->class_list[p_type].brief_description;
item->set_tooltip(0,description); item->set_tooltip(0,description);

View File

@ -517,6 +517,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("scenetree_editor/duplicate_node_name_num_separator",0); 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"); 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/start_create_dialog_fully_expanded",false);
set("gridmap_editor/pick_distance", 5000.0); set("gridmap_editor/pick_distance", 5000.0);