mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:47:46 +00:00
LibGUI: Make Layout a Core::Object and add basic serialization
This allows you to view layouts (as data) in Inspector.
This commit is contained in:
parent
ecc39678f5
commit
849fdc1c0b
8 changed files with 66 additions and 13 deletions
|
@ -29,14 +29,16 @@
|
|||
#include <AK/OwnPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibGUI/Forward.h>
|
||||
#include <LibGUI/Margins.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class Layout {
|
||||
class Layout : public Core::Object {
|
||||
C_OBJECT_ABSTRACT(Layout);
|
||||
|
||||
public:
|
||||
Layout();
|
||||
virtual ~Layout();
|
||||
|
||||
void add_widget(Widget&);
|
||||
|
@ -57,7 +59,11 @@ public:
|
|||
int spacing() const { return m_spacing; }
|
||||
void set_spacing(int);
|
||||
|
||||
virtual void save_to(JsonObject&) override;
|
||||
|
||||
protected:
|
||||
Layout();
|
||||
|
||||
struct Entry {
|
||||
enum class Type {
|
||||
Invalid = 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue