mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:47:44 +00:00
Userland: Use Widget::add_spacer() everywhere
This commit is contained in:
parent
43dddafd16
commit
9561ec15f4
17 changed files with 23 additions and 23 deletions
|
@ -331,7 +331,7 @@ void ColorPicker::build_ui_custom(Widget& root_container)
|
|||
// Preview selected color
|
||||
m_preview_widget = preview_container.add<ColorPreview>(m_color);
|
||||
|
||||
vertical_container.layout()->add_spacer();
|
||||
vertical_container.add_spacer().release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
// HTML
|
||||
auto& html_container = vertical_container.add<GUI::Widget>();
|
||||
|
|
|
@ -104,7 +104,7 @@ void InputBox::build()
|
|||
button_container_inner.set_layout<HorizontalBoxLayout>();
|
||||
button_container_inner.set_preferred_height(SpecialDimension::Fit);
|
||||
button_container_inner.layout()->set_spacing(6);
|
||||
button_container_inner.layout()->add_spacer();
|
||||
button_container_inner.add_spacer().release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
m_ok_button = button_container_inner.add<DialogButton>();
|
||||
m_ok_button->set_text(String::from_utf8_short_string("OK"sv));
|
||||
|
|
|
@ -165,7 +165,7 @@ void MessageBox::build()
|
|||
return button;
|
||||
};
|
||||
|
||||
button_container.layout()->add_spacer();
|
||||
button_container.add_spacer().release_value_but_fixme_should_propagate_errors();
|
||||
if (should_include_ok_button())
|
||||
m_ok_button = add_button(String::from_utf8_short_string("OK"sv), ExecResult::OK);
|
||||
if (should_include_yes_button())
|
||||
|
@ -174,7 +174,7 @@ void MessageBox::build()
|
|||
m_no_button = add_button(String::from_utf8_short_string("No"sv), ExecResult::No);
|
||||
if (should_include_cancel_button())
|
||||
m_cancel_button = add_button(String::from_utf8_short_string("Cancel"sv), ExecResult::Cancel);
|
||||
button_container.layout()->add_spacer();
|
||||
button_container.add_spacer().release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
int width = (button_count * button_width) + ((button_count - 1) * button_container.layout()->spacing()) + 32;
|
||||
width = max(width, text_width + icon_width + 56);
|
||||
|
|
|
@ -50,7 +50,7 @@ ProcessChooser::ProcessChooser(StringView window_title, String button_label, Gfx
|
|||
button_container.set_fixed_height(30);
|
||||
button_container.set_layout<GUI::HorizontalBoxLayout>();
|
||||
button_container.layout()->set_margins({ 0, 4, 0 });
|
||||
button_container.layout()->add_spacer();
|
||||
button_container.add_spacer().release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
auto& select_button = button_container.add<GUI::Button>(m_button_label);
|
||||
select_button.set_fixed_width(80);
|
||||
|
|
|
@ -52,7 +52,7 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(DeprecatedString t
|
|||
};
|
||||
}
|
||||
|
||||
TRY(button_container->layout()->try_add_spacer());
|
||||
TRY(button_container->add_spacer());
|
||||
|
||||
window->m_ok_button = TRY(button_container->try_add<GUI::DialogButton>(String::from_utf8_short_string("OK"sv)));
|
||||
window->m_ok_button->on_click = [window = window->make_weak_ptr<SettingsWindow>()](auto) {
|
||||
|
|
|
@ -176,7 +176,7 @@ ErrorOr<void> Toolbar::create_overflow_objects()
|
|||
m_overflow_action->set_status_tip("Show hidden toolbar actions");
|
||||
m_overflow_action->set_enabled(false);
|
||||
|
||||
TRY(layout()->try_add_spacer());
|
||||
TRY(add_spacer());
|
||||
|
||||
m_overflow_button = TRY(try_add_action(*m_overflow_action));
|
||||
m_overflow_button->set_visible(false);
|
||||
|
|
|
@ -44,7 +44,7 @@ WizardDialog::WizardDialog(Window* parent_window)
|
|||
nav_container_widget.set_fixed_height(42);
|
||||
nav_container_widget.layout()->set_margins({ 0, 10 });
|
||||
nav_container_widget.layout()->set_spacing(0);
|
||||
nav_container_widget.layout()->add_spacer();
|
||||
nav_container_widget.add_spacer().release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
m_back_button = nav_container_widget.add<DialogButton>(String::from_utf8_short_string("< Back"sv));
|
||||
m_back_button->on_click = [&](auto) {
|
||||
|
|
|
@ -34,7 +34,7 @@ WizardPage::WizardPage(DeprecatedString const& title_text, DeprecatedString cons
|
|||
m_subtitle_label = header_widget.add<Label>(subtitle_text);
|
||||
m_subtitle_label->set_text_alignment(Gfx::TextAlignment::TopLeft);
|
||||
m_subtitle_label->set_fixed_height(m_subtitle_label->font().glyph_height());
|
||||
header_widget.layout()->add_spacer();
|
||||
header_widget.add_spacer().release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
auto& separator = add<SeparatorWidget>(Gfx::Orientation::Horizontal);
|
||||
separator.set_fixed_height(2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue