summaryrefslogtreecommitdiff
path: root/editor/editor_properties.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r--editor/editor_properties.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 378dd34e39..30fb561fbe 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -1842,10 +1842,20 @@ void EditorPropertyColor::_popup_closed() {
emit_changed(get_edited_property(), picker->get_pick_color(), "", false);
}
+void EditorPropertyColor::_picker_created() {
+ // get default color picker mode from editor settings
+ int default_color_mode = EDITOR_GET("interface/inspector/default_color_picker_mode");
+ if (default_color_mode == 1)
+ picker->get_picker()->set_hsv_mode(true);
+ else if (default_color_mode == 2)
+ picker->get_picker()->set_raw_mode(true);
+}
+
void EditorPropertyColor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_color_changed"), &EditorPropertyColor::_color_changed);
ClassDB::bind_method(D_METHOD("_popup_closed"), &EditorPropertyColor::_popup_closed);
+ ClassDB::bind_method(D_METHOD("_picker_created"), &EditorPropertyColor::_picker_created);
}
void EditorPropertyColor::update_property() {
@@ -1864,6 +1874,7 @@ EditorPropertyColor::EditorPropertyColor() {
picker->set_flat(true);
picker->connect("color_changed", this, "_color_changed");
picker->connect("popup_closed", this, "_popup_closed");
+ picker->connect("picker_created", this, "_picker_created");
}
////////////// NODE PATH //////////////////////
@@ -2540,7 +2551,7 @@ void EditorPropertyResource::update_property() {
if (res.is_valid() != assign->is_toggle_mode()) {
assign->set_toggle_mode(res.is_valid());
}
-#ifdef TOOLS_ENABLED
+
if (res.is_valid() && get_edited_object()->editor_is_section_unfolded(get_edited_property())) {
if (!sub_inspector) {
@@ -2609,7 +2620,6 @@ void EditorPropertyResource::update_property() {
}
}
}
-#endif
}
preview->set_texture(Ref<Texture>());