1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 17:05:10 +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:
Sam Atkins 2023-02-16 17:11:57 +00:00 committed by Sam Atkins
parent ab6ef53247
commit 43dddafd16
4 changed files with 14 additions and 10 deletions

View file

@ -14,7 +14,9 @@ REGISTER_ABSTRACT_CORE_OBJECT(GUI, Layout)
namespace GUI {
Layout::Layout()
Layout::Layout(Margins initial_margins, int spacing)
: m_margins(initial_margins)
, m_spacing(spacing)
{
REGISTER_INT_PROPERTY("spacing", spacing, set_spacing);
REGISTER_MARGINS_PROPERTY("margins", margins, set_margins);