mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 01:51:03 +09:00
LibGUI: Allow setting widget visibility from JSON GUI spec
This commit is contained in:
parent
8a7935a29f
commit
6fc8dedd28
Notes:
sideshowbarker
2024-07-19 02:25:30 +09:00
Author: https://github.com/awesomekling
Commit: 6fc8dedd28
1 changed files with 4 additions and 0 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue