mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
LibGUI: Implement save_to(JsonObject&) for GWindow and GWidget
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/JsonObject.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibC/SharedBuffer.h>
|
||||
#include <LibC/stdio.h>
|
||||
@@ -696,3 +697,16 @@ Vector<GWidget*> GWindow::focusable_widgets() const
|
||||
collect_focusable_widgets(*m_main_widget);
|
||||
return collected_widgets;
|
||||
}
|
||||
|
||||
void GWindow::save_to(AK::JsonObject& json)
|
||||
{
|
||||
json.set("title", title());
|
||||
json.set("visible", is_visible());
|
||||
json.set("active", is_active());
|
||||
json.set("resizable", is_resizable());
|
||||
json.set("fullscreen", is_fullscreen());
|
||||
json.set("rect", rect().to_string());
|
||||
json.set("base_size", base_size().to_string());
|
||||
json.set("size_increment", size_increment().to_string());
|
||||
CObject::save_to(json);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user