LibGfx+LibGUI: Allow theming the focus outline of AbstractButton

This commit is contained in:
Tibor Nagy 2020-02-20 13:36:58 +01:00 committed by Andreas Kling
parent e490fc9e35
commit 6e2a16c8a8
Notes: sideshowbarker 2024-07-19 09:11:55 +09:00
9 changed files with 9 additions and 1 deletions

View file

@ -41,3 +41,4 @@ RulerBorder=#666666
RulerActiveText=white
RulerInactiveText=#d5d0c7
TextCursor=#9c9cd5
FocusOutline=#606060

View file

@ -41,3 +41,4 @@ RulerBorder=#404040
RulerActiveText=#404040
RulerInactiveText=#808080
TextCursor=red
FocusOutline=#909090

View file

@ -41,3 +41,4 @@ RulerBorder=black
RulerActiveText=yellow
RulerInactiveText=white
TextCursor=black
FocusOutline=#909090

View file

@ -41,3 +41,4 @@ RulerBorder=#3b4252
RulerActiveText=#95adc5
RulerInactiveText=#7e9dbc
TextCursor=#7e9dbc
FocusOutline=#7e9dbc

View file

@ -41,3 +41,4 @@ RulerBorder=#606060
RulerActiveText=#404040
RulerInactiveText=#808080
TextCursor=#ee3532
FocusOutline=#909090

View file

@ -186,7 +186,7 @@ void AbstractButton::paint_text(Painter& painter, const Gfx::Rect& rect, const G
return;
painter.draw_text(clipped_rect, text(), font, text_alignment, palette().button_text(), Gfx::TextElision::Right);
if (is_focused())
painter.draw_rect(clipped_rect.inflated(6, 4), Color(140, 140, 140));
painter.draw_rect(clipped_rect.inflated(6, 4), palette().focus_outline());
}
void AbstractButton::change_event(Event& event)

View file

@ -99,6 +99,7 @@ public:
Color ruler_active_text() const { return color(ColorRole::RulerActiveText); }
Color ruler_inactive_text() const { return color(ColorRole::RulerInactiveText); }
Color text_cursor() const { return color(ColorRole::TextCursor); }
Color focus_outline() const { return color(ColorRole::FocusOutline); }
Color link() const { return color(ColorRole::Link); }
Color active_link() const { return color(ColorRole::ActiveLink); }

View file

@ -113,6 +113,7 @@ RefPtr<SharedBuffer> load_system_theme(const String& path)
DO_COLOR(RulerActiveText);
DO_COLOR(RulerInactiveText);
DO_COLOR(TextCursor);
DO_COLOR(FocusOutline);
buffer->seal();
buffer->share_globally();

View file

@ -76,6 +76,7 @@ enum class ColorRole {
RulerActiveText,
RulerInactiveText,
TextCursor,
FocusOutline,
__Count,