LibGUI: Allow specifying Layout margins and spacing in the constructor

This is comfier than `my_widget->layout()->set_margins(...)`.
This commit is contained in:
Sam Atkins 2023-02-16 17:11:57 +00:00 committed by Sam Atkins
parent ab6ef53247
commit 43dddafd16
Notes: sideshowbarker 2024-07-17 02:06:40 +09:00
4 changed files with 14 additions and 10 deletions

View file

@ -17,8 +17,9 @@ REGISTER_LAYOUT(GUI, VerticalBoxLayout)
namespace GUI {
BoxLayout::BoxLayout(Orientation orientation)
: m_orientation(orientation)
BoxLayout::BoxLayout(Orientation orientation, Margins margins, int spacing)
: Layout(margins, spacing)
, m_orientation(orientation)
{
register_property(
"orientation", [this] { return m_orientation == Gfx::Orientation::Vertical ? "Vertical" : "Horizontal"; }, nullptr);