aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde2017-05-02 11:25:25 +0200
committerGitHub2017-05-02 11:25:25 +0200
commitdd5fd4fdacf0504ff26c773f29ae7a5aa419d88b (patch)
treea3af7724350d20bd4fe62d2b4a85b641018a41d0
parentfb8cee9af9a649d0458e65a02839f5a51a16cc79 (diff)
parent9a0e08a35263ede46f7cacf9290ba1407f4eb733 (diff)
downloadgodot-dd5fd4fdacf0504ff26c773f29ae7a5aa419d88b.tar.gz
godot-dd5fd4fdacf0504ff26c773f29ae7a5aa419d88b.tar.zst
godot-dd5fd4fdacf0504ff26c773f29ae7a5aa419d88b.zip
Merge pull request #8542 from RandomShaper/opt-out-capitalization-2.1
Add setting to opt-out of capitalization in property inspectors (2.1)
Diffstat (limited to '')
-rw-r--r--editor/editor_node.cpp2
-rw-r--r--editor/project_settings.cpp2
-rw-r--r--editor/property_editor.cpp13
-rw-r--r--editor/property_editor.h3
-rw-r--r--editor/script_editor_debugger.cpp2
5 files changed, 14 insertions, 8 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index ec1c4a499..1dccf7065 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -404,6 +404,7 @@ void EditorNode::_notification(int p_what) {
if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
scene_tabs->set_tab_close_display_policy((bool(EDITOR_DEF("global/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY));
+ property_editor->set_enable_capitalize_paths(bool(EDITOR_DEF("inspector/capitalize_properties", true)));
}
}
@@ -5877,6 +5878,7 @@ EditorNode::EditorNode() {
property_editor->set_show_categories(true);
property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
property_editor->set_use_doc_hints(true);
+ property_editor->set_enable_capitalize_paths(bool(EDITOR_DEF("inspector/capitalize_properties", true)));
property_editor->hide_top_label();
property_editor->register_text_enter(search_box);
diff --git a/editor/project_settings.cpp b/editor/project_settings.cpp
index 025c827d6..d1714212a 100644
--- a/editor/project_settings.cpp
+++ b/editor/project_settings.cpp
@@ -1293,7 +1293,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
//globals_editor->hide_top_label();
globals_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
globals_editor->get_property_editor()->register_text_enter(search_box);
- globals_editor->get_property_editor()->set_capitalize_paths(false);
+ globals_editor->get_property_editor()->set_enable_capitalize_paths(false);
globals_editor->get_property_editor()->get_scene_tree()->connect("cell_selected", this, "_item_selected");
globals_editor->get_property_editor()->connect("property_toggled", this, "_item_checked", varray(), CONNECT_DEFERRED);
globals_editor->get_property_editor()->connect("property_edited", this, "_settings_prop_edited");
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index c4aa2d921..e6a17b7be 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -2428,10 +2428,7 @@ TreeItem *PropertyEditor::get_parent_node(String p_path, HashMap<String, TreeIte
item = tree->create_item(parent);
String name = (p_path.find("/") != -1) ? p_path.right(p_path.find_last("/") + 1) : p_path;
- if (capitalize_paths)
- item->set_text(0, name.capitalize());
- else
- item->set_text(0, name);
+ item->set_text(0, capitalize_paths ? name.capitalize() : name);
item->set_tooltip(0, p_path);
if (item->get_parent() != root) {
item->set_icon(0, get_icon("Folder", "EditorIcons"));
@@ -3832,9 +3829,15 @@ String PropertyEditor::get_selected_path() const {
return "";
}
-void PropertyEditor::set_capitalize_paths(bool p_capitalize) {
+bool PropertyEditor::is_capitalize_paths_enabled() const {
+
+ return capitalize_paths;
+}
+
+void PropertyEditor::set_enable_capitalize_paths(bool p_capitalize) {
capitalize_paths = p_capitalize;
+ update_tree_pending = true;
}
void PropertyEditor::set_autoclear(bool p_enable) {
diff --git a/editor/property_editor.h b/editor/property_editor.h
index 18c6e4b89..1acd1fe85 100644
--- a/editor/property_editor.h
+++ b/editor/property_editor.h
@@ -262,7 +262,8 @@ public:
custom_editor->set_read_only(p_read_only);
}
- void set_capitalize_paths(bool p_capitalize);
+ bool is_capitalize_paths_enabled() const;
+ void set_enable_capitalize_paths(bool p_capitalize);
void set_autoclear(bool p_enable);
void set_show_categories(bool p_show);
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 68f48dd94..05ca71e78 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -1624,7 +1624,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
inspector->set_h_size_flags(SIZE_EXPAND_FILL);
inspector->hide_top_label();
inspector->get_scene_tree()->set_column_title(0, TTR("Variable"));
- inspector->set_capitalize_paths(false);
+ inspector->set_enable_capitalize_paths(false);
inspector->set_read_only(true);
sc->add_child(inspector);