mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 20:25:07 +00:00
LibGUI: Implement save_to(JsonObject&) for GWindow and GWidget
This commit is contained in:
parent
c2213449c0
commit
3792c91059
4 changed files with 45 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue