Modify color in ColorPicker with keyboard or joypad

This commit is contained in:
Konrad Gadzina 2024-11-07 13:27:11 +01:00
parent 4f0cbc9a58
commit e6f812c056
8 changed files with 539 additions and 8 deletions

View file

@ -1040,6 +1040,9 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_constant("separation", "VSeparator", Math::round(4 * scale));
// ColorPicker
Ref<StyleBoxFlat> focus_circle = make_flat_stylebox(style_focus_color, default_margin, default_margin, default_margin, default_margin, default_corner_radius, false, 2);
focus_circle->set_corner_radius_all(Math::round(256 * scale));
focus_circle->set_corner_detail(Math::round(32 * scale));
theme->set_constant("margin", "ColorPicker", Math::round(4 * scale));
theme->set_constant("sv_width", "ColorPicker", Math::round(256 * scale));
@ -1048,6 +1051,11 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_constant("label_width", "ColorPicker", Math::round(10 * scale));
theme->set_constant("center_slider_grabbers", "ColorPicker", 1);
theme->set_stylebox("sample_focus", "ColorPicker", focus);
theme->set_stylebox("picker_focus_rectangle", "ColorPicker", focus);
theme->set_stylebox("picker_focus_circle", "ColorPicker", focus_circle);
theme->set_color("focused_not_editing_cursor_color", "ColorPicker", Color(1, 1, 1, 0.275f));
theme->set_icon("menu_option", "ColorPicker", icons["tabs_menu_hl"]);
theme->set_icon("folded_arrow", "ColorPicker", icons["arrow_right"]);
theme->set_icon("expanded_arrow", "ColorPicker", icons["arrow_down"]);
@ -1120,6 +1128,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
preset_sb->set_anti_aliased(false);
theme->set_stylebox("preset_fg", "ColorPresetButton", preset_sb);
theme->set_stylebox("preset_focus", "ColorPicker", focus);
theme->set_icon("preset_bg", "ColorPresetButton", icons["mini_checkerboard"]);
theme->set_icon("overbright_indicator", "ColorPresetButton", icons["color_picker_overbright"]);