1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 14:14:58 +00:00

LibGUI: Highlight interactive area of hovered CheckBox and RadioButton

This is consistent what we do for regular Buttons and gives a pleasant
visual cue when you're over a clickable area.
This commit is contained in:
Andreas Kling 2020-05-08 21:11:23 +02:00
parent d92f62db43
commit 03c91fce74
2 changed files with 9 additions and 0 deletions

View file

@ -75,6 +75,9 @@ void CheckBox::paint_event(PaintEvent& event)
if (fill_with_background_color())
painter.fill_rect(rect(), palette().window());
if (is_enabled() && is_hovered())
painter.fill_rect(rect(), palette().hover_highlight());
Gfx::Rect box_rect {
0, height() / 2 - s_box_height / 2 - 1,
s_box_width, s_box_height