mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibGUI: Remove Widget::try_set_layout<T>()
And fall back to the infallible set_layout<T>(). Work towards #20557.
This commit is contained in:
@@ -152,11 +152,11 @@ ErrorOr<void> MessageBox::build()
|
||||
{
|
||||
auto main_widget = TRY(set_main_widget<Widget>());
|
||||
main_widget->set_fill_with_background_color(true);
|
||||
TRY(main_widget->try_set_layout<VerticalBoxLayout>(8, 6));
|
||||
main_widget->set_layout<VerticalBoxLayout>(8, 6);
|
||||
|
||||
auto message_container = TRY(main_widget->try_add<Widget>());
|
||||
auto message_margins = Margins { 8, m_type != Type::None ? 8 : 0 };
|
||||
TRY(message_container->try_set_layout<HorizontalBoxLayout>(message_margins, 8));
|
||||
message_container->set_layout<HorizontalBoxLayout>(message_margins, 8);
|
||||
|
||||
if (auto icon = TRY(this->icon()); icon && m_type != Type::None) {
|
||||
auto image_widget = TRY(message_container->try_add<ImageWidget>());
|
||||
@@ -170,7 +170,7 @@ ErrorOr<void> MessageBox::build()
|
||||
m_text_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
||||
auto button_container = TRY(main_widget->try_add<Widget>());
|
||||
TRY(button_container->try_set_layout<HorizontalBoxLayout>(Margins {}, 8));
|
||||
button_container->set_layout<HorizontalBoxLayout>(Margins {}, 8);
|
||||
|
||||
auto add_button = [&](String text, ExecResult result) -> ErrorOr<NonnullRefPtr<Button>> {
|
||||
auto button = TRY(button_container->try_add<DialogButton>());
|
||||
|
||||
Reference in New Issue
Block a user