summaryrefslogtreecommitdiff
path: root/Userland/Applications/Calendar/AddEventDialog.cpp
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-01-06 16:48:37 +0000
committerAndrew Kaster <andrewdkaster@gmail.com>2023-01-06 13:36:02 -0700
commit0c24522635ec7f07e1fb69d9e1cd350d81e2248f (patch)
tree391782374bada7ee7a986674229551c2ec21f75a /Userland/Applications/Calendar/AddEventDialog.cpp
parentd223477bc650e271008ccc339fc1e2c0fcc079e7 (diff)
downloadserenity-0c24522635ec7f07e1fb69d9e1cd350d81e2248f.zip
LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)
Rip that bandaid off! This does the following, in one big, awkward jump: - Replace all uses of `set_main_widget<Foo>()` with the `try` version. - Remove `set_main_widget<Foo>()`. - Rename the `try` version to just be `set_main_widget` because it's now the only one. The majority of places that call `set_main_widget<Foo>()` are inside constructors, so this unfortunately gives us a big batch of new `release_value_but_fixme_should_propagate_errors()` calls.
Diffstat (limited to 'Userland/Applications/Calendar/AddEventDialog.cpp')
-rw-r--r--Userland/Applications/Calendar/AddEventDialog.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Userland/Applications/Calendar/AddEventDialog.cpp b/Userland/Applications/Calendar/AddEventDialog.cpp
index 4951885d2c..058bd52cdd 100644
--- a/Userland/Applications/Calendar/AddEventDialog.cpp
+++ b/Userland/Applications/Calendar/AddEventDialog.cpp
@@ -28,11 +28,11 @@ AddEventDialog::AddEventDialog(Core::DateTime date_time, Window* parent_window)
set_resizable(false);
set_icon(parent_window->icon());
- auto& widget = set_main_widget<GUI::Widget>();
- widget.set_fill_with_background_color(true);
- widget.set_layout<GUI::VerticalBoxLayout>();
+ auto widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
+ widget->set_fill_with_background_color(true);
+ widget->set_layout<GUI::VerticalBoxLayout>();
- auto& top_container = widget.add<GUI::Widget>();
+ auto& top_container = widget->add<GUI::Widget>();
top_container.set_layout<GUI::VerticalBoxLayout>();
top_container.set_fixed_height(45);
top_container.layout()->set_margins(4);
@@ -45,12 +45,12 @@ AddEventDialog::AddEventDialog(Core::DateTime date_time, Window* parent_window)
auto& event_title_textbox = top_container.add<GUI::TextBox>();
event_title_textbox.set_fixed_height(20);
- auto& middle_container = widget.add<GUI::Widget>();
+ auto& middle_container = widget->add<GUI::Widget>();
middle_container.set_layout<GUI::HorizontalBoxLayout>();
middle_container.set_fixed_height(25);
middle_container.layout()->set_margins(4);
- auto& time_container = widget.add<GUI::Widget>();
+ auto& time_container = widget->add<GUI::Widget>();
time_container.set_layout<GUI::HorizontalBoxLayout>();
time_container.set_fixed_height(25);
time_container.layout()->set_margins(4);
@@ -87,9 +87,9 @@ AddEventDialog::AddEventDialog(Core::DateTime date_time, Window* parent_window)
starting_meridiem_combo.set_model(MeridiemListModel::create());
starting_meridiem_combo.set_selected_index(0);
- widget.layout()->add_spacer();
+ widget->layout()->add_spacer();
- auto& button_container = widget.add<GUI::Widget>();
+ auto& button_container = widget->add<GUI::Widget>();
button_container.set_fixed_height(20);
button_container.set_layout<GUI::HorizontalBoxLayout>();
button_container.layout()->add_spacer();