1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-29 14:27:35 +00:00

LibGUI: Remove Layout::try_add_spacer()

And fall back to the infallible add_spacer().

Work towards #20557.
This commit is contained in:
Andreas Kling 2023-08-13 18:29:05 +02:00
parent 8322b31b97
commit 58e482a06d
22 changed files with 28 additions and 35 deletions

View file

@ -69,7 +69,7 @@ DownloadWidget::DownloadWidget(const URL& url)
m_browser_image = animation_container.add<GUI::ImageWidget>();
m_browser_image->load_from_file("/res/graphics/download-animation.gif"sv);
animation_container.add_spacer().release_value_but_fixme_should_propagate_errors();
animation_container.add_spacer();
auto& source_label = add<GUI::Label>(String::formatted("File: {}", m_url.basename()).release_value_but_fixme_should_propagate_errors());
source_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
@ -102,7 +102,7 @@ DownloadWidget::DownloadWidget(const URL& url)
auto& button_container = add<GUI::Widget>();
button_container.set_layout<GUI::HorizontalBoxLayout>();
button_container.add_spacer().release_value_but_fixme_should_propagate_errors();
button_container.add_spacer();
m_cancel_button = button_container.add<GUI::Button>("Cancel"_string);
m_cancel_button->set_fixed_size(100, 22);
m_cancel_button->on_click = [this](auto) {

View file

@ -88,12 +88,12 @@ AddEventDialog::AddEventDialog(Core::DateTime date_time, EventManager& event_man
starting_meridiem_combo.set_model(MeridiemListModel::create());
starting_meridiem_combo.set_selected_index(0);
widget->add_spacer().release_value_but_fixme_should_propagate_errors();
widget->add_spacer();
auto& button_container = widget->add<GUI::Widget>();
button_container.set_fixed_height(20);
button_container.set_layout<GUI::HorizontalBoxLayout>();
button_container.add_spacer().release_value_but_fixme_should_propagate_errors();
button_container.add_spacer();
auto& ok_button = button_container.add<GUI::Button>("OK"_string);
ok_button.set_fixed_size(80, 20);
ok_button.on_click = [&](auto) {

View file

@ -82,7 +82,7 @@ ErrorOr<void> PropertiesWindow::create_widgets(bool disable_rename)
button_widget->set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 5);
button_widget->set_fixed_height(22);
TRY(button_widget->add_spacer());
button_widget->add_spacer();
auto ok_button = TRY(make_button("OK"_string, button_widget));
ok_button->on_click = [this](auto) {

View file

@ -94,7 +94,7 @@ void KeyboardMapperWidget::create_frame()
add_map_radio_button("alt_map"sv, "Alt"_string);
add_map_radio_button("shift_altgr_map"sv, "Shift+AltGr"_string);
bottom_widget.add_spacer().release_value_but_fixme_should_propagate_errors();
bottom_widget.add_spacer();
}
void KeyboardMapperWidget::add_map_radio_button(const StringView map_name, String button_text)

View file

@ -36,7 +36,7 @@ ErrorOr<NonnullRefPtr<TrackControlsWidget>> TrackControlsWidget::try_create(Weak
TRY(widget->m_processor_groups.try_append(mastering_parameters));
TRY(widget->add_spacer());
widget->add_spacer();
for (auto& processor : strong_track->processor_chain()) {
auto processor_parameters = TRY(widget->try_add<GUI::GroupBox>());

View file

@ -295,7 +295,7 @@ ErrorOr<GUI::Widget*> GradientTool::get_properties_widget()
auto button_container = TRY(properties_widget->try_add<GUI::Widget>());
button_container->set_fixed_height(22);
button_container->set_layout<GUI::HorizontalBoxLayout>();
button_container->add_spacer().release_value_but_fixme_should_propagate_errors();
button_container->add_spacer();
auto apply_button = TRY(button_container->try_add<GUI::DialogButton>("Apply"_string));
apply_button->on_click = [this](auto) {

View file

@ -55,7 +55,7 @@ CellTypeDialog::CellTypeDialog(Vector<Position> const& positions, Sheet& sheet,
auto& buttonbox = main_widget->add<GUI::Widget>();
buttonbox.set_shrink_to_fit(true);
buttonbox.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 10);
buttonbox.add_spacer().release_value_but_fixme_should_propagate_errors();
buttonbox.add_spacer();
auto& ok_button = buttonbox.add<GUI::Button>("OK"_string);
ok_button.set_fixed_width(80);
ok_button.on_click = [&](auto) { done(ExecResult::OK); };