1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:47:44 +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());

View file

@ -388,7 +388,7 @@ ErrorOr<int> run_in_desktop_mode()
window->set_icon(desktop_icon);
auto desktop_widget = TRY(window->set_main_widget<FileManager::DesktopWidget>());
TRY(desktop_widget->try_set_layout<GUI::VerticalBoxLayout>());
desktop_widget->set_layout<GUI::VerticalBoxLayout>();
auto directory_view = TRY(desktop_widget->try_add<DirectoryView>(DirectoryView::Mode::Desktop));
directory_view->set_name("directory_view");