1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

LibCore+LibGUI: Add fallible versions of Widget::load_from_gml()

The existing `load_from_gml()` methods look the same as before from the
outside. Inside though, they now forward to `try_load_from_gml()` which
returns Error when things go wrong. It also now calls the `try_create()`
factory method for Objects instead of the `construct()` one.
This commit is contained in:
Sam Atkins 2022-12-28 20:35:16 +00:00 committed by Tim Flynn
parent e58fe1cdd7
commit b32f5dbcff
8 changed files with 73 additions and 69 deletions

View file

@ -30,7 +30,7 @@ private:
void update_widget_size();
void update_widget_position();
void update_widget_min_size();
virtual bool load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(DeprecatedString const&)) override;
virtual ErrorOr<void> load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::Object> (*unregistered_child_handler)(DeprecatedString const&)) override;
ScrollableContainerWidget();