From d172783d339db6b3ba128c0a65286d82bf1ebcaa Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 26 Oct 2020 21:08:01 +0100 Subject: [PATCH] LibGUI: Fix bogus focus rect in buttons with icon but no text --- Libraries/LibGUI/Button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibGUI/Button.cpp b/Libraries/LibGUI/Button.cpp index f8a4aba224..93539907b5 100644 --- a/Libraries/LibGUI/Button.cpp +++ b/Libraries/LibGUI/Button.cpp @@ -95,7 +95,7 @@ void Button::paint_event(PaintEvent& event) if (is_focused()) { Gfx::IntRect focus_rect; - if (m_icon) + if (m_icon && !text().is_empty()) focus_rect = text_rect.inflated(6, 6); else focus_rect = rect().shrunken(8, 8);