mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
GRadioButton: Draw a focus rect when focused.
This commit is contained in:
parent
677794f30d
commit
508007f1dd
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…
Add table
Add a link
Reference in a new issue