mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
GRadioButton: Draw a focus rect when focused.
This commit is contained in:
parent
677794f30d
commit
508007f1dd
Notes:
sideshowbarker
2024-07-19 13:58:18 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/508007f1dd1
1 changed files with 3 additions and 0 deletions
|
@ -49,6 +49,9 @@ void GRadioButton::paint_event(GPaintEvent& event)
|
|||
Rect text_rect { circle_rect.right() + 4, 0, font().width(text()), font().glyph_height() };
|
||||
text_rect.center_vertically_within(rect());
|
||||
painter.draw_text(text_rect, text(), TextAlignment::CenterLeft, foreground_color());
|
||||
|
||||
if (is_focused())
|
||||
painter.draw_rect(text_rect.inflated(6, 4), Color(140, 140, 140));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue