1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +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

@ -58,11 +58,12 @@ public:
Margins const& margins() const { return m_margins; }
void set_margins(Margins const&);
static constexpr int default_spacing = 3;
int spacing() const { return m_spacing; }
void set_spacing(int);
protected:
Layout();
Layout(Margins, int spacing);
struct Entry {
enum class Type {
@ -83,7 +84,7 @@ protected:
Vector<Entry> m_entries;
Margins m_margins;
int m_spacing { 3 };
int m_spacing { default_spacing };
};
}