1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +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:
Andreas Kling 2023-08-13 14:52:36 +02:00
parent 341626e2ea
commit 8322b31b97
52 changed files with 127 additions and 135 deletions

View file

@ -34,13 +34,13 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(DeprecatedString t
auto main_widget = TRY(window->set_main_widget<GUI::Widget>());
main_widget->set_fill_with_background_color(true);
TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>(4, 6));
main_widget->set_layout<GUI::VerticalBoxLayout>(4, 6);
window->m_tab_widget = TRY(main_widget->try_add<GUI::TabWidget>());
auto button_container = TRY(main_widget->try_add<GUI::Widget>());
button_container->set_preferred_size({ SpecialDimension::Grow, SpecialDimension::Fit });
TRY(button_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 6));
button_container->set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 6);
if (show_defaults_button == ShowDefaultsButton::Yes) {
window->m_reset_button = TRY(button_container->try_add<GUI::DialogButton>("Defaults"_string));