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

@ -24,13 +24,13 @@ ErrorOr<void> CoverWizardPage::build(String title, String subtitle)
{
set_fill_with_background_color(true);
set_background_role(Gfx::ColorRole::Base);
TRY(try_set_layout<HorizontalBoxLayout>());
set_layout<HorizontalBoxLayout>();
m_banner_image_widget = TRY(try_add<ImageWidget>());
m_banner_image_widget->set_fixed_size(160, 315);
m_banner_image_widget->load_from_file("/res/graphics/wizard-banner-simple.png"sv);
m_content_widget = TRY(try_add<Widget>());
TRY(m_content_widget->try_set_layout<VerticalBoxLayout>(20));
m_content_widget->set_layout<VerticalBoxLayout>(20);
m_header_label = TRY(m_content_widget->try_add<Label>(move(title)));
m_header_label->set_font(Gfx::FontDatabase::the().get("Pebbleton", 14, 700, Gfx::FontWidth::Normal, 0));