mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:57:36 +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:
parent
e403796842
commit
e1e856132c
1 changed files with 8 additions and 1 deletions
|
@ -202,9 +202,16 @@ void GMLAutocompleteProvider::provide_completions(Function<void(Vector<Entry>)>
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!class_names.is_empty())
|
if (!class_names.is_empty()) {
|
||||||
register_class_properties_matching_pattern("*", 0u);
|
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) {
|
Core::ObjectClassRegistration::for_each([&](const Core::ObjectClassRegistration& registration) {
|
||||||
if (!registration.is_derived_from(widget_class))
|
if (!registration.is_derived_from(widget_class))
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue