1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:37:34 +00:00

LibGUI: Don't suggest widgets inside layouts

Having a widget inside a layout is meaningless, so why suggest them in
the first place?
This commit is contained in:
thislooksfun 2021-10-27 18:49:49 -05:00 committed by Andreas Kling
parent e403796842
commit e1e856132c

View file

@ -202,9 +202,16 @@ void GMLAutocompleteProvider::provide_completions(Function<void(Vector<Entry>)>
break;
}
}
if (!class_names.is_empty())
if (!class_names.is_empty()) {
register_class_properties_matching_pattern("*", 0u);
auto parent_registration = Core::ObjectClassRegistration::find(class_names.last());
if (parent_registration && parent_registration->is_derived_from(layout_class)) {
// Layouts can't have child classes, so why suggest them?
break;
}
}
Core::ObjectClassRegistration::for_each([&](const Core::ObjectClassRegistration& registration) {
if (!registration.is_derived_from(widget_class))
return;