mirror of
https://github.com/RGBCube/serenity
synced 2025-07-03 00:42:14 +00:00
LibGUI: Improve GBoxLayout so it can better support GToolBar.
Added spacing and margin concepts to GLayout. Support layout a sequence of nothing but fixed-size objects in the desired orientation. :^)
This commit is contained in:
parent
b704d3d295
commit
dc753b58a5
5 changed files with 84 additions and 20 deletions
|
@ -4,6 +4,7 @@
|
|||
#include <AK/OwnPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibGUI/GMargins.h>
|
||||
|
||||
class GWidget;
|
||||
|
||||
|
@ -20,6 +21,12 @@ public:
|
|||
void notify_adopted(Badge<GWidget>, GWidget&);
|
||||
void notify_disowned(Badge<GWidget>, GWidget&);
|
||||
|
||||
GMargins margins() const { return m_margins; }
|
||||
void set_margins(const GMargins&);
|
||||
|
||||
int spacing() const { return m_spacing; }
|
||||
void set_spacing(int);
|
||||
|
||||
protected:
|
||||
struct Entry {
|
||||
WeakPtr<GWidget> widget;
|
||||
|
@ -27,5 +34,8 @@ protected:
|
|||
};
|
||||
WeakPtr<GWidget> m_owner;
|
||||
Vector<Entry> m_entries;
|
||||
|
||||
GMargins m_margins;
|
||||
int m_spacing { 0 };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue