From 4970c448bfdf308d8f6ae9316b8a5429b4d848de Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Tue, 14 Jul 2020 11:50:34 -0400 Subject: [PATCH] LibGUI: Draw contiguous frame if GroupBox title is left empty --- Libraries/LibGUI/GroupBox.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Libraries/LibGUI/GroupBox.cpp b/Libraries/LibGUI/GroupBox.cpp index 1ff52384f9..17b722f1f2 100644 --- a/Libraries/LibGUI/GroupBox.cpp +++ b/Libraries/LibGUI/GroupBox.cpp @@ -52,9 +52,11 @@ void GroupBox::paint_event(PaintEvent& event) }; Gfx::StylePainter::paint_frame(painter, frame_rect, palette(), Gfx::FrameShape::Box, Gfx::FrameShadow::Sunken, 2); - Gfx::IntRect text_rect { 4, 0, font().width(m_title) + 6, font().glyph_height() }; - painter.fill_rect(text_rect, palette().button()); - painter.draw_text(text_rect, m_title, Gfx::TextAlignment::Center, palette().button_text()); + if (!m_title.is_empty()) { + Gfx::IntRect text_rect { 4, 0, font().width(m_title) + 6, font().glyph_height() }; + painter.fill_rect(text_rect, palette().button()); + painter.draw_text(text_rect, m_title, Gfx::TextAlignment::Center, palette().button_text()); + } } void GroupBox::set_title(const StringView& title)