mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibGUI: Draw contiguous frame if GroupBox title is left empty
This commit is contained in:
parent
1dfae92eac
commit
4970c448bf
Notes:
sideshowbarker
2024-07-19 04:50:09 +09:00
Author: https://github.com/thankyouverycool Commit: https://github.com/SerenityOS/serenity/commit/4970c448bfd Pull-request: https://github.com/SerenityOS/serenity/pull/2797
1 changed files with 5 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue