1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:17:35 +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:
Andreas Kling 2020-03-05 09:21:46 +01:00
parent ecc39678f5
commit 849fdc1c0b
8 changed files with 66 additions and 13 deletions

View file

@ -24,6 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <AK/JsonObject.h>
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Widget.h>
#include <LibGfx/Orientation.h>
@ -174,4 +175,10 @@ void BoxLayout::run(Widget& widget)
}
}
void BoxLayout::save_to(JsonObject& json)
{
Layout::save_to(json);
json.set("orientation", m_orientation == Gfx::Orientation::Vertical ? "Vertical" : "Horizontal");
}
}