summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp2
-rw-r--r--editor/editor_properties.cpp7
-rw-r--r--editor/plugins/script_text_editor.cpp6
-rw-r--r--editor/property_editor.cpp6
4 files changed, 4 insertions, 17 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index eafbf11df0..6243ebc852 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -6136,7 +6136,7 @@ EditorNode::EditorNode() {
EDITOR_DEF("interface/inspector/open_resources_in_current_inspector", true);
EDITOR_DEF("interface/inspector/resources_to_open_in_new_inspector", "Script,MeshLibrary");
EDITOR_DEF("interface/inspector/default_color_picker_mode", 0);
- EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "interface/inspector/default_color_picker_mode", PROPERTY_HINT_ENUM, "RGB,HSV,RAW", PROPERTY_USAGE_DEFAULT));
+ EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "interface/inspector/default_color_picker_mode", PROPERTY_HINT_ENUM, "RGB,HSV,RAW,OKHSL", PROPERTY_USAGE_DEFAULT));
EDITOR_DEF("interface/inspector/default_color_picker_shape", (int32_t)ColorPicker::SHAPE_OKHSL_CIRCLE);
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "interface/inspector/default_color_picker_shape", PROPERTY_HINT_ENUM, "HSV Rectangle,HSV Rectangle Wheel,VHS Circle,OKHSL Circle", PROPERTY_USAGE_DEFAULT));
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 6a035225e5..d06d22ae5b 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -3010,12 +3010,7 @@ void EditorPropertyColor::_popup_closed() {
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);
- }
-
+ picker->get_picker()->set_color_mode((ColorPicker::ColorModeType)default_color_mode);
int picker_shape = EDITOR_GET("interface/inspector/default_color_picker_shape");
picker->get_picker()->set_picker_shape((ColorPicker::PickerShapeType)picker_shape);
}
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 7c3520c39d..66cd85a26a 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -1865,11 +1865,7 @@ void ScriptTextEditor::_enable_code_editor() {
// 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) {
- color_picker->set_hsv_mode(true);
- } else if (default_color_mode == 2) {
- color_picker->set_raw_mode(true);
- }
+ color_picker->set_color_mode((ColorPicker::ColorModeType)default_color_mode);
int picker_shape = EDITOR_GET("interface/inspector/default_color_picker_shape");
color_picker->set_picker_shape((ColorPicker::PickerShapeType)picker_shape);
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index d936e821df..9f13a9d520 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -831,11 +831,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
// 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) {
- color_picker->set_hsv_mode(true);
- } else if (default_color_mode == 2) {
- color_picker->set_raw_mode(true);
- }
+ color_picker->set_color_mode((ColorPicker::ColorModeType)default_color_mode);
int picker_shape = EDITOR_GET("interface/inspector/default_color_picker_shape");
color_picker->set_picker_shape((ColorPicker::PickerShapeType)picker_shape);