1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-12 10:40:39 +09:00

Userland: Specify margins and spacing in the GUI::Layout constructor

This commit is contained in:
Sam Atkins 2023-02-16 21:07:06 +00:00 committed by Sam Atkins
parent 9561ec15f4
commit 77ad0fdb07
Notes: sideshowbarker 2024-07-17 06:29:49 +09:00
64 changed files with 136 additions and 288 deletions

View file

@ -42,8 +42,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
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);
(void)TRY(catdog_widget->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 0));
auto context_menu = TRY(GUI::Menu::try_create());
TRY(context_menu->try_add_action(GUI::CommonActions::make_about_action("CatDog Demo", app_icon, window)));
@ -63,8 +62,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
advice_window->set_alpha_hit_threshold(1.0f);
auto advice_widget = TRY(advice_window->set_main_widget<SpeechBubble>(catdog_widget));
(void)TRY(advice_widget->try_set_layout<GUI::VerticalBoxLayout>());
advice_widget->layout()->set_spacing(0);
(void)TRY(advice_widget->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 0));
auto advice_timer = TRY(Core::Timer::create_single_shot(15'000, [&] {
window->move_to_front();