mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
LibGUI: Improve GBoxLayout so it can better support GToolBar.
Added spacing and margin concepts to GLayout. Support layout a sequence of nothing but fixed-size objects in the desired orientation. :^)
This commit is contained in:
@@ -39,3 +39,21 @@ void GLayout::add_widget(GWidget& widget)
|
||||
if (m_owner)
|
||||
m_owner->notify_layout_changed(Badge<GLayout>());
|
||||
}
|
||||
|
||||
void GLayout::set_spacing(int spacing)
|
||||
{
|
||||
if (m_spacing == spacing)
|
||||
return;
|
||||
m_spacing = spacing;
|
||||
if (m_owner)
|
||||
m_owner->notify_layout_changed(Badge<GLayout>());
|
||||
}
|
||||
|
||||
void GLayout::set_margins(const GMargins& margins)
|
||||
{
|
||||
if (m_margins == margins)
|
||||
return;
|
||||
m_margins = margins;
|
||||
if (m_owner)
|
||||
m_owner->notify_layout_changed(Badge<GLayout>());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user