1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

LibGUI: Adjust focus rect for Buttons with icons

Reduced focus rect inflation value for buttons with icons
to match the expected focus rect for buttons without icons.

As mentioned in 'SerenityOS Office Hours / Q&A (2021-12-17)'
This commit is contained in:
PerikiyoXD 2021-12-19 10:51:32 +01:00 committed by Andreas Kling
parent 9271005357
commit ff49285a02

View file

@ -89,7 +89,7 @@ void Button::paint_event(PaintEvent& event)
if (is_focused()) {
Gfx::IntRect focus_rect;
if (m_icon && !text().is_empty())
focus_rect = text_rect.inflated(6, 6);
focus_rect = text_rect.inflated(4, 4);
else
focus_rect = rect().shrunken(8, 8);
painter.draw_focus_rect(focus_rect, palette().focus_outline());