summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-09-14 13:04:21 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-14 16:16:36 +0200
commit6fc8dedd2808536ddbb546daa44a26353fa175f6 (patch)
treed95f681eaac539f4b0bae5807784e801ffbf7f4e /Libraries/LibGUI
parent8a7935a29f957220d8acd786e5ed203e8a470907 (diff)
downloadserenity-6fc8dedd2808536ddbb546daa44a26353fa175f6.zip
LibGUI: Allow setting widget visibility from JSON GUI spec
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r--Libraries/LibGUI/Widget.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibGUI/Widget.cpp b/Libraries/LibGUI/Widget.cpp
index 03599eaac0..6308500592 100644
--- a/Libraries/LibGUI/Widget.cpp
+++ b/Libraries/LibGUI/Widget.cpp
@@ -940,6 +940,10 @@ bool Widget::load_from_json(const JsonObject& json)
if (fill_with_background_color.is_bool())
set_fill_with_background_color(fill_with_background_color.to_bool());
+ auto visible = json.get("visible");
+ if (visible.is_bool())
+ set_visible(visible.to_bool());
+
auto preferred_height = json.get("preferred_height");
if (preferred_height.is_number())
set_preferred_size(preferred_size().width(), preferred_height.to_i32());