mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
LibGUI: Move widget registration to LibCore
This also moves Widget::load_from_json into Core::Object as a virtual function in order to allow loading non-widget objects in GML (e.g. BoxLayout). Co-authored-by: Gunnar Beutner <gbeutner@serenityos.org>
This commit is contained in:
parent
6e101adc28
commit
3aaffa2c47
13 changed files with 134 additions and 85 deletions
|
@ -128,7 +128,7 @@ int main(int argc, char** argv)
|
|||
|
||||
editor.on_change = [&] {
|
||||
preview.remove_all_children();
|
||||
preview.load_from_gml(editor.text(), [](const String& class_name) -> RefPtr<GUI::Widget> {
|
||||
preview.load_from_gml(editor.text(), [](const String& class_name) -> RefPtr<Core::Object> {
|
||||
return UnregisteredWidget::construct(class_name);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue