1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:47:45 +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

@ -71,7 +71,7 @@ PropertiesWindow::PropertiesWindow(DeprecatedString const& path, Window* parent_
ErrorOr<void> PropertiesWindow::create_widgets(bool disable_rename)
{
auto main_widget = TRY(set_main_widget<GUI::Widget>());
TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>(4, 6));
main_widget->set_layout<GUI::VerticalBoxLayout>(4, 6);
main_widget->set_fill_with_background_color(true);
auto tab_widget = TRY(main_widget->try_add<GUI::TabWidget>());
@ -79,7 +79,7 @@ ErrorOr<void> PropertiesWindow::create_widgets(bool disable_rename)
TRY(create_file_type_specific_tabs(tab_widget));
auto button_widget = TRY(main_widget->try_add<GUI::Widget>());
TRY(button_widget->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 5));
button_widget->set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 5);
button_widget->set_fixed_height(22);
TRY(button_widget->add_spacer());