diff options
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r-- | editor/editor_properties.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index d7b3c7733b..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 ////////////////////// |