mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 19:45:08 +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:
parent
b704d3d295
commit
dc753b58a5
5 changed files with 84 additions and 20 deletions
|
@ -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>());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue