mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibGUI: Implement content_margins for GroupBox
This commit is contained in:
parent
72139e1262
commit
4955769ab8
Notes:
sideshowbarker
2024-07-18 01:31:41 +09:00
Author: https://github.com/frhun
Commit: 4955769ab8
Pull-request: https://github.com/SerenityOS/serenity/pull/10246
Issue: https://github.com/SerenityOS/serenity/issues/5887
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
2 changed files with 11 additions and 0 deletions
|
@ -24,6 +24,16 @@ GroupBox::~GroupBox()
|
|||
{
|
||||
}
|
||||
|
||||
Margins GroupBox::content_margins() const
|
||||
{
|
||||
return {
|
||||
(!m_title.is_empty() ? font().glyph_height() + 1 /*room for the focus rect*/ : 2),
|
||||
2,
|
||||
2,
|
||||
2
|
||||
};
|
||||
}
|
||||
|
||||
void GroupBox::paint_event(PaintEvent& event)
|
||||
{
|
||||
Painter painter(*this);
|
||||
|
|
|
@ -17,6 +17,7 @@ public:
|
|||
|
||||
String title() const { return m_title; }
|
||||
void set_title(const StringView&);
|
||||
virtual Margins content_margins() const override;
|
||||
|
||||
protected:
|
||||
explicit GroupBox(const StringView& title = {});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue