Browse Source

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.
Karol Kosek 3 years ago
parent
commit
c6bcc0f96e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp

+ 2 - 2
Userland/Libraries/LibGUI/ScrollableContainerWidget.cpp

@@ -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();