Skip to content

Commit

Permalink
GRadioButton: Draw a focus rect when focused.
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed May 24, 2019
1 parent 677794f commit 508007f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions LibGUI/GRadioButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down

0 comments on commit 508007f

Please sign in to comment.