mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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
Notes:
sideshowbarker
2024-07-19 08:54:19 +09:00
Author: https://github.com/awesomekling
Commit: 849fdc1c0b
8 changed files with 66 additions and 13 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue