mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibGfx+LibGUI: Allow theming the focus outline of AbstractButton
This commit is contained in:
parent
e490fc9e35
commit
6e2a16c8a8
Notes:
sideshowbarker
2024-07-19 09:11:55 +09:00
Author: https://github.com/xTibor Commit: https://github.com/SerenityOS/serenity/commit/6e2a16c8a8c Pull-request: https://github.com/SerenityOS/serenity/pull/1255
9 changed files with 9 additions and 1 deletions
|
@ -41,3 +41,4 @@ RulerBorder=#666666
|
|||
RulerActiveText=white
|
||||
RulerInactiveText=#d5d0c7
|
||||
TextCursor=#9c9cd5
|
||||
FocusOutline=#606060
|
||||
|
|
|
@ -41,3 +41,4 @@ RulerBorder=#404040
|
|||
RulerActiveText=#404040
|
||||
RulerInactiveText=#808080
|
||||
TextCursor=red
|
||||
FocusOutline=#909090
|
||||
|
|
|
@ -41,3 +41,4 @@ RulerBorder=black
|
|||
RulerActiveText=yellow
|
||||
RulerInactiveText=white
|
||||
TextCursor=black
|
||||
FocusOutline=#909090
|
||||
|
|
|
@ -41,3 +41,4 @@ RulerBorder=#3b4252
|
|||
RulerActiveText=#95adc5
|
||||
RulerInactiveText=#7e9dbc
|
||||
TextCursor=#7e9dbc
|
||||
FocusOutline=#7e9dbc
|
||||
|
|
|
@ -41,3 +41,4 @@ RulerBorder=#606060
|
|||
RulerActiveText=#404040
|
||||
RulerInactiveText=#808080
|
||||
TextCursor=#ee3532
|
||||
FocusOutline=#909090
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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); }
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -76,6 +76,7 @@ enum class ColorRole {
|
|||
RulerActiveText,
|
||||
RulerInactiveText,
|
||||
TextCursor,
|
||||
FocusOutline,
|
||||
|
||||
__Count,
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue