|
@@ -46,7 +46,7 @@ CellTypeDialog::CellTypeDialog(Vector<Position> const& positions, Sheet& sheet,
|
|
|
resize(285, 360);
|
|
|
|
|
|
auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
|
|
|
- main_widget->set_layout<GUI::VerticalBoxLayout>().set_margins(4);
|
|
|
+ main_widget->set_layout<GUI::VerticalBoxLayout>(4);
|
|
|
main_widget->set_fill_with_background_color(true);
|
|
|
|
|
|
auto& tab_widget = main_widget->add<GUI::TabWidget>();
|
|
@@ -54,8 +54,7 @@ CellTypeDialog::CellTypeDialog(Vector<Position> const& positions, Sheet& sheet,
|
|
|
|
|
|
auto& buttonbox = main_widget->add<GUI::Widget>();
|
|
|
buttonbox.set_shrink_to_fit(true);
|
|
|
- auto& button_layout = buttonbox.set_layout<GUI::HorizontalBoxLayout>();
|
|
|
- button_layout.set_spacing(10);
|
|
|
+ buttonbox.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 10);
|
|
|
buttonbox.add_spacer().release_value_but_fixme_should_propagate_errors();
|
|
|
auto& ok_button = buttonbox.add<GUI::Button>(String::from_utf8_short_string("OK"sv));
|
|
|
ok_button.set_fixed_width(80);
|
|
@@ -134,7 +133,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po
|
|
|
}
|
|
|
|
|
|
auto& type_tab = tabs.add_tab<GUI::Widget>("Type");
|
|
|
- type_tab.set_layout<GUI::HorizontalBoxLayout>().set_margins(4);
|
|
|
+ type_tab.set_layout<GUI::HorizontalBoxLayout>(4);
|
|
|
{
|
|
|
auto& left_side = type_tab.add<GUI::Widget>();
|
|
|
left_side.set_layout<GUI::VerticalBoxLayout>();
|
|
@@ -199,14 +198,13 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po
|
|
|
}
|
|
|
|
|
|
auto& alignment_tab = tabs.add_tab<GUI::Widget>("Alignment");
|
|
|
- alignment_tab.set_layout<GUI::VerticalBoxLayout>().set_margins(4);
|
|
|
+ alignment_tab.set_layout<GUI::VerticalBoxLayout>(4);
|
|
|
{
|
|
|
// FIXME: Frame?
|
|
|
// Horizontal alignment
|
|
|
{
|
|
|
auto& horizontal_alignment_selection_container = alignment_tab.add<GUI::Widget>();
|
|
|
- horizontal_alignment_selection_container.set_layout<GUI::HorizontalBoxLayout>();
|
|
|
- horizontal_alignment_selection_container.layout()->set_margins({ 4, 0, 0 });
|
|
|
+ horizontal_alignment_selection_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 0 });
|
|
|
horizontal_alignment_selection_container.set_fixed_height(22);
|
|
|
|
|
|
auto& horizontal_alignment_label = horizontal_alignment_selection_container.add<GUI::Label>();
|
|
@@ -237,8 +235,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po
|
|
|
// Vertical alignment
|
|
|
{
|
|
|
auto& vertical_alignment_container = alignment_tab.add<GUI::Widget>();
|
|
|
- vertical_alignment_container.set_layout<GUI::HorizontalBoxLayout>();
|
|
|
- vertical_alignment_container.layout()->set_margins({ 4, 0, 0 });
|
|
|
+ vertical_alignment_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 0 });
|
|
|
vertical_alignment_container.set_fixed_height(22);
|
|
|
|
|
|
auto& vertical_alignment_label = vertical_alignment_container.add<GUI::Label>();
|
|
@@ -268,7 +265,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po
|
|
|
}
|
|
|
|
|
|
auto& colors_tab = tabs.add_tab<GUI::Widget>("Color");
|
|
|
- colors_tab.set_layout<GUI::VerticalBoxLayout>().set_margins(4);
|
|
|
+ colors_tab.set_layout<GUI::VerticalBoxLayout>(4);
|
|
|
{
|
|
|
// Static formatting
|
|
|
{
|
|
@@ -279,8 +276,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po
|
|
|
{
|
|
|
// FIXME: Somehow allow unsetting these.
|
|
|
auto& foreground_container = static_formatting_container.add<GUI::Widget>();
|
|
|
- foreground_container.set_layout<GUI::HorizontalBoxLayout>();
|
|
|
- foreground_container.layout()->set_margins({ 4, 0, 0 });
|
|
|
+ foreground_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 0 });
|
|
|
foreground_container.set_preferred_height(GUI::SpecialDimension::Fit);
|
|
|
|
|
|
auto& foreground_label = foreground_container.add<GUI::Label>();
|
|
@@ -299,8 +295,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po
|
|
|
{
|
|
|
// FIXME: Somehow allow unsetting these.
|
|
|
auto& background_container = static_formatting_container.add<GUI::Widget>();
|
|
|
- background_container.set_layout<GUI::HorizontalBoxLayout>();
|
|
|
- background_container.layout()->set_margins({ 4, 0, 0 });
|
|
|
+ background_container.set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 0 });
|
|
|
background_container.set_preferred_height(GUI::SpecialDimension::Fit);
|
|
|
|
|
|
auto& background_label = background_container.add<GUI::Label>();
|
|
@@ -427,9 +422,7 @@ ConditionView::~ConditionView()
|
|
|
|
|
|
ConditionsView::ConditionsView()
|
|
|
{
|
|
|
- auto& layout = set_layout<GUI::VerticalBoxLayout>();
|
|
|
- layout.set_spacing(4);
|
|
|
- layout.set_margins({ 6 });
|
|
|
+ set_layout<GUI::VerticalBoxLayout>(6, 4);
|
|
|
}
|
|
|
|
|
|
void ConditionsView::set_formats(Vector<ConditionalFormat>* formats)
|