From 1dce43d417784e79aedcb0b4d53a4a97145c47af Mon Sep 17 00:00:00 2001 From: Vitika9 Date: Thu, 30 Jun 2022 17:04:32 +0530 Subject: ColorPicker UX improvements - Tabs and MenuButton for mode selection and enabling/disabling colorized sliders - MenuButton for shape selection with new icon for each shape - Drag and drop functionality for presets to arrange order - A chronological list of recently selected presets which are global for the editor - Presets are now highlighted as being active or inactive - Thicker sliders for easy targeting - `grabber_offset` theme constant for Slider - Uncolorized sliders --- editor/editor_themes.cpp | 5 +++ editor/icons/PickerShapeCircle.svg | 1 + editor/icons/PickerShapeRectangle.svg | 1 + editor/icons/PickerShapeRectangleWheel.svg | 58 ++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 editor/icons/PickerShapeCircle.svg create mode 100644 editor/icons/PickerShapeRectangle.svg create mode 100644 editor/icons/PickerShapeRectangleWheel.svg (limited to 'editor') diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 6934c2d13c..ab0751dd23 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -1457,6 +1457,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_stylebox("slider", "HSlider", make_flat_stylebox(dark_color_3, 0, default_margin_size / 2, 0, default_margin_size / 2, corner_width)); theme->set_stylebox("grabber_area", "HSlider", make_flat_stylebox(contrast_color_1, 0, default_margin_size / 2, 0, default_margin_size / 2, corner_width)); theme->set_stylebox("grabber_area_highlight", "HSlider", make_flat_stylebox(contrast_color_1, 0, default_margin_size / 2, 0, default_margin_size / 2)); + theme->set_constant("grabber_offset", "HSlider", 0); // VSlider theme->set_icon("grabber", "VSlider", theme->get_icon(SNAME("GuiSliderGrabber"), SNAME("EditorIcons"))); @@ -1464,6 +1465,7 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_stylebox("slider", "VSlider", make_flat_stylebox(dark_color_3, default_margin_size / 2, 0, default_margin_size / 2, 0, corner_width)); theme->set_stylebox("grabber_area", "VSlider", make_flat_stylebox(contrast_color_1, default_margin_size / 2, 0, default_margin_size / 2, 0, corner_width)); theme->set_stylebox("grabber_area_highlight", "VSlider", make_flat_stylebox(contrast_color_1, default_margin_size / 2, 0, default_margin_size / 2, 0)); + theme->set_constant("grabber_offset", "VSlider", 0); // RichTextLabel theme->set_color("default_color", "RichTextLabel", font_color); @@ -1704,6 +1706,9 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_constant("h_width", "ColorPicker", 30 * EDSCALE); theme->set_constant("label_width", "ColorPicker", 10 * EDSCALE); theme->set_icon("screen_picker", "ColorPicker", theme->get_icon(SNAME("ColorPick"), SNAME("EditorIcons"))); + theme->set_icon("shape_circle", "ColorPicker", theme->get_icon(SNAME("PickerShapeCircle"), SNAME("EditorIcons"))); + theme->set_icon("shape_rect", "ColorPicker", theme->get_icon(SNAME("PickerShapeRectangle"), SNAME("EditorIcons"))); + theme->set_icon("shape_rect_wheel", "ColorPicker", theme->get_icon(SNAME("PickerShapeRectangleWheel"), SNAME("EditorIcons"))); theme->set_icon("add_preset", "ColorPicker", theme->get_icon(SNAME("Add"), SNAME("EditorIcons"))); theme->set_icon("sample_bg", "ColorPicker", theme->get_icon(SNAME("GuiMiniCheckerboard"), SNAME("EditorIcons"))); theme->set_icon("overbright_indicator", "ColorPicker", theme->get_icon(SNAME("OverbrightIndicator"), SNAME("EditorIcons"))); diff --git a/editor/icons/PickerShapeCircle.svg b/editor/icons/PickerShapeCircle.svg new file mode 100644 index 0000000000..8e7fb7f06e --- /dev/null +++ b/editor/icons/PickerShapeCircle.svg @@ -0,0 +1 @@ + diff --git a/editor/icons/PickerShapeRectangle.svg b/editor/icons/PickerShapeRectangle.svg new file mode 100644 index 0000000000..3c7dd46884 --- /dev/null +++ b/editor/icons/PickerShapeRectangle.svg @@ -0,0 +1 @@ + diff --git a/editor/icons/PickerShapeRectangleWheel.svg b/editor/icons/PickerShapeRectangleWheel.svg new file mode 100644 index 0000000000..e85665a8f2 --- /dev/null +++ b/editor/icons/PickerShapeRectangleWheel.svg @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + -- cgit v1.2.3