mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:57:45 +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
|
@ -242,12 +242,15 @@ void Widget::handle_paint_event(PaintEvent& event)
|
|||
second_paint_event(event);
|
||||
}
|
||||
|
||||
void Widget::set_layout(OwnPtr<Layout>&& layout)
|
||||
void Widget::set_layout(NonnullRefPtr<Layout> layout)
|
||||
{
|
||||
if (m_layout)
|
||||
if (m_layout) {
|
||||
m_layout->notify_disowned({}, *this);
|
||||
m_layout->remove_from_parent();
|
||||
}
|
||||
m_layout = move(layout);
|
||||
if (m_layout) {
|
||||
add_child(*m_layout);
|
||||
m_layout->notify_adopted({}, *this);
|
||||
do_layout();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue