diff options
author | K. S. Ernest (iFire) Lee <fire@users.noreply.github.com> | 2021-08-22 08:23:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-22 08:23:09 -0700 |
commit | 7cbf5a547fc02ba53688f3206fb2198d117b64fa (patch) | |
tree | f669c89b573e8ced159b1dfd4ef5c5515605e1f1 /editor | |
parent | f303c2dfb527c84421e0226cc24ab9babf9cac8a (diff) | |
parent | ff9901f51e00b9bf1702b011af5ef5798b82af89 (diff) |
Merge pull request #51700 from Geometror/fix-color-picker
Reimplement ColorPicker presets
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_themes.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 4496180ddd..8c348731d6 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -1361,7 +1361,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_constant("label_width", "ColorPicker", 10 * EDSCALE); theme->set_icon("screen_picker", "ColorPicker", theme->get_icon("ColorPick", "EditorIcons")); theme->set_icon("add_preset", "ColorPicker", theme->get_icon("Add", "EditorIcons")); - theme->set_icon("preset_bg", "ColorPicker", theme->get_icon("GuiMiniCheckerboard", "EditorIcons")); + theme->set_icon("sample_bg", "ColorPicker", theme->get_icon("GuiMiniCheckerboard", "EditorIcons")); theme->set_icon("overbright_indicator", "ColorPicker", theme->get_icon("OverbrightIndicator", "EditorIcons")); theme->set_icon("bar_arrow", "ColorPicker", theme->get_icon("ColorPickerBarArrow", "EditorIcons")); theme->set_icon("picker_cursor", "ColorPicker", theme->get_icon("PickerCursor", "EditorIcons")); @@ -1369,6 +1369,13 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // ColorPickerButton theme->set_icon("bg", "ColorPickerButton", theme->get_icon("GuiMiniCheckerboard", "EditorIcons")); + // ColorPresetButton + Ref<StyleBoxFlat> preset_sb = make_flat_stylebox(Color(1, 1, 1), 2, 2, 2, 2, 2); + preset_sb->set_anti_aliased(false); + theme->set_stylebox("preset_fg", "ColorPresetButton", preset_sb); + theme->set_icon("preset_bg", "ColorPresetButton", theme->get_icon("GuiMiniCheckerboard", "EditorIcons")); + theme->set_icon("overbright_indicator", "ColorPresetButton", theme->get_icon("OverbrightIndicator", "EditorIcons")); + // Information on 3D viewport Ref<StyleBoxFlat> style_info_3d_viewport = style_default->duplicate(); style_info_3d_viewport->set_bg_color(style_info_3d_viewport->get_bg_color() * Color(1, 1, 1, 0.5)); |