summaryrefslogtreecommitdiff
path: root/editor/editor_inspector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_inspector.cpp')
-rw-r--r--editor/editor_inspector.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 675ef808e1..f5d318a227 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -36,6 +36,7 @@
#include "editor/doc_tools.h"
#include "editor/editor_feature_profile.h"
#include "editor/editor_node.h"
+#include "editor/editor_property_name_processor.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
#include "multi_node_edit.h"
@@ -99,7 +100,7 @@ void EditorProperty::emit_changed(const StringName &p_property, const Variant &p
const Variant *argptrs[4] = { &args[0], &args[1], &args[2], &args[3] };
cache[p_property] = p_value;
- emit_signal(SNAME("property_changed"), (const Variant **)argptrs, 4);
+ emit_signalp(SNAME("property_changed"), (const Variant **)argptrs, 4);
}
void EditorProperty::_notification(int p_what) {
@@ -691,15 +692,11 @@ void EditorProperty::unhandled_key_input(const Ref<InputEvent> &p_event) {
}
const Color *EditorProperty::_get_property_colors() {
- const Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor"));
- const float saturation = base.get_s() * 0.75;
- const float value = base.get_v();
-
static Color c[4];
- c[0].set_hsv(0.0 / 3.0 + 0.05, saturation, value);
- c[1].set_hsv(1.0 / 3.0 + 0.05, saturation, value);
- c[2].set_hsv(2.0 / 3.0 + 0.05, saturation, value);
- c[3].set_hsv(1.5 / 3.0 + 0.05, saturation, value);
+ c[0] = get_theme_color(SNAME("property_color_x"), SNAME("Editor"));
+ c[1] = get_theme_color(SNAME("property_color_y"), SNAME("Editor"));
+ c[2] = get_theme_color(SNAME("property_color_z"), SNAME("Editor"));
+ c[3] = get_theme_color(SNAME("property_color_w"), SNAME("Editor"));
return c;
}
@@ -2684,10 +2681,10 @@ void EditorInspector::update_tree() {
if (dot != -1) {
String ov = property_label_string.substr(dot);
property_label_string = property_label_string.substr(0, dot);
- property_label_string = property_label_string.capitalize();
+ property_label_string = EditorPropertyNameProcessor::get_singleton()->process_name(property_label_string);
property_label_string += ov;
} else {
- property_label_string = property_label_string.capitalize();
+ property_label_string = EditorPropertyNameProcessor::get_singleton()->process_name(property_label_string);
}
}
@@ -2738,13 +2735,15 @@ void EditorInspector::update_tree() {
current_vbox->add_child(section);
sections.push_back(section);
+ String label = component;
if (capitalize_paths) {
- component = component.capitalize();
+ label = EditorPropertyNameProcessor::get_singleton()->process_name(label);
}
Color c = sscolor;
c.a /= level;
- section->setup(acc_path, component, object, c, use_folding, section_depth);
+ section->setup(acc_path, label, object, c, use_folding, section_depth);
+ section->set_tooltip(EditorPropertyNameProcessor::get_singleton()->make_tooltip_for_name(component));
// Add editors at the start of a group.
for (Ref<EditorInspectorPlugin> &ped : valid_plugins) {
@@ -2776,7 +2775,7 @@ void EditorInspector::update_tree() {
editor_inspector_array = memnew(EditorInspectorArray);
String array_label = path.contains("/") ? path.substr(path.rfind("/") + 1) : path;
- array_label = property_label_string.capitalize();
+ array_label = EditorPropertyNameProcessor::get_singleton()->process_name(property_label_string);
int page = per_array_page.has(array_element_prefix) ? per_array_page[array_element_prefix] : 0;
editor_inspector_array->setup_with_move_element_function(object, array_label, array_element_prefix, page, c, use_folding);
editor_inspector_array->connect("page_change_request", callable_mp(this, &EditorInspector::_page_change_request), varray(array_element_prefix));
@@ -3318,7 +3317,7 @@ void EditorInspector::_property_keyed(const String &p_path, bool p_advance) {
// The second parameter could be null, causing the event to fire with less arguments, so use the pointer call which preserves it.
const Variant args[3] = { p_path, object->get(p_path), p_advance };
const Variant *argp[3] = { &args[0], &args[1], &args[2] };
- emit_signal(SNAME("property_keyed"), argp, 3);
+ emit_signalp(SNAME("property_keyed"), argp, 3);
}
void EditorInspector::_property_deleted(const String &p_path) {
@@ -3337,7 +3336,7 @@ void EditorInspector::_property_keyed_with_value(const String &p_path, const Var
// The second parameter could be null, causing the event to fire with less arguments, so use the pointer call which preserves it.
const Variant args[3] = { p_path, p_value, p_advance };
const Variant *argp[3] = { &args[0], &args[1], &args[2] };
- emit_signal(SNAME("property_keyed"), argp, 3);
+ emit_signalp(SNAME("property_keyed"), argp, 3);
}
void EditorInspector::_property_checked(const String &p_path, bool p_checked) {
@@ -3514,7 +3513,9 @@ void EditorInspector::_notification(int p_what) {
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
_update_inspector_bg();
- update_tree();
+ if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/inspector")) {
+ update_tree();
+ }
} break;
}
}