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:
parent
ab6ef53247
commit
43dddafd16
4 changed files with 14 additions and 10 deletions
|
@ -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 };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue