LibGUI: Check if a property is a GML Object in ScrollableContainerWidget

Previously we couldn't set the content widget from GML because it was
looking for a GUI::Object, not a GML::Object.
This commit is contained in:
Karol Kosek 2022-05-07 09:53:53 +02:00 committed by Linus Groh
parent f8aea2a7e5
commit c6bcc0f96e
Notes: sideshowbarker 2024-07-17 11:13:27 +09:00

View file

@ -96,7 +96,7 @@ bool ScrollableContainerWidget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node>
});
auto content_widget_value = object->get_property("content_widget"sv);
if (!content_widget_value.is_null() && !is<Object>(content_widget_value.ptr())) {
if (!content_widget_value.is_null() && !is<GUI::GML::Object>(content_widget_value.ptr())) {
dbgln("content widget is not an object");
return false;
}
@ -108,7 +108,7 @@ bool ScrollableContainerWidget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node>
return false;
}
if (!content_widget_value.is_null() && is<Object>(content_widget_value.ptr())) {
if (!content_widget_value.is_null() && is<GUI::GML::Object>(content_widget_value.ptr())) {
auto content_widget = static_ptr_cast<GUI::GML::Object>(content_widget_value);
auto class_name = content_widget->name();