mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 11:34:59 +00:00
LibGUI: Allow specifying Layout margins and spacing in the constructor
This is comfier than `my_widget->layout()->set_margins(...)`.
This commit is contained in:
parent
ab6ef53247
commit
43dddafd16
4 changed files with 14 additions and 10 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue