1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:47:34 +00:00

CatDog: Make a factory function for CatDog and propagate errors

This fixes an astonishing 22 FIXMEs. :^)
This commit is contained in:
Andreas Kling 2022-12-13 16:38:09 +01:00 committed by Linus Groh
parent ddb22cf10d
commit cba9df1c53
3 changed files with 56 additions and 24 deletions

View file

@ -40,7 +40,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_alpha_hit_threshold(1.0f);
window->set_icon(app_icon.bitmap_for_size(16));
auto catdog_widget = TRY(window->try_set_main_widget<CatDog>());
auto catdog_widget = TRY(CatDog::create());
window->set_main_widget(catdog_widget);
(void)TRY(catdog_widget->try_set_layout<GUI::VerticalBoxLayout>());
catdog_widget->layout()->set_spacing(0);