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

LibGUI: Remove Layout::try_add_spacer()

And fall back to the infallible add_spacer().

Work towards #20557.
This commit is contained in:
Andreas Kling 2023-08-13 18:29:05 +02:00
parent 8322b31b97
commit 58e482a06d
22 changed files with 28 additions and 35 deletions

View file

@ -1199,7 +1199,7 @@ ErrorOr<void> Widget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node const> ast,
if (!this->layout()) {
return Error::from_string_literal("Specified GUI::Layout::Spacer in GML, but the parent has no Layout.");
}
this->layout()->add_spacer();
add_spacer();
} else {
RefPtr<Core::EventReceiver> child;
if (auto* registration = GUI::ObjectClassRegistration::find(class_name)) {
@ -1259,10 +1259,10 @@ bool Widget::is_visible_for_timer_purposes() const
return is_visible() && Object::is_visible_for_timer_purposes();
}
ErrorOr<void> Widget::add_spacer()
void Widget::add_spacer()
{
VERIFY(layout());
return layout()->try_add_spacer();
return layout()->add_spacer();
}
}