diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-20 22:39:24 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-20 22:39:24 +0200 |
commit | aa2224a2f05961b571ced26b504dd5eac84db994 (patch) | |
tree | 99548538e3dc99a2837abb523eee0bcab9b072ef /Applications/PaintBrush | |
parent | 5b440a72f957e31e526d7f11f918dd6ec749c9bf (diff) | |
download | serenity-aa2224a2f05961b571ced26b504dd5eac84db994.zip |
GWidget: Add set_preferred_size(width, height) overload.
It was annoying to always write set_preferred_size({ width, height }). :^)
Diffstat (limited to 'Applications/PaintBrush')
-rw-r--r-- | Applications/PaintBrush/ColorDialog.cpp | 6 | ||||
-rw-r--r-- | Applications/PaintBrush/PaletteWidget.cpp | 2 | ||||
-rw-r--r-- | Applications/PaintBrush/ToolboxWidget.cpp | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/Applications/PaintBrush/ColorDialog.cpp b/Applications/PaintBrush/ColorDialog.cpp index e1e7eb90ef..c05c24dd8b 100644 --- a/Applications/PaintBrush/ColorDialog.cpp +++ b/Applications/PaintBrush/ColorDialog.cpp @@ -41,13 +41,13 @@ void ColorDialog::build() right_vertical_container->layout()->add_spacer(); auto* cancel_button = new GButton("Cancel", right_vertical_container); cancel_button->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); - cancel_button->set_preferred_size({ 0, 20 }); + cancel_button->set_preferred_size(0, 20); cancel_button->on_click = [&](auto&) { done(GDialog::ExecCancel); }; auto* ok_button = new GButton("Okay", right_vertical_container); ok_button->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); - ok_button->set_preferred_size({ 0, 20 }); + ok_button->set_preferred_size(0, 20); ok_button->on_click = [&](auto&) { done(GDialog::ExecOK); }; @@ -55,7 +55,7 @@ void ColorDialog::build() auto make_spinbox = [&](RGBComponent component, int initial_value) { auto* spinbox = new GSpinBox(left_vertical_container); spinbox->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); - spinbox->set_preferred_size({ 0, 20 }); + spinbox->set_preferred_size(0, 20); spinbox->set_min(0); spinbox->set_max(255); spinbox->set_value(initial_value); diff --git a/Applications/PaintBrush/PaletteWidget.cpp b/Applications/PaintBrush/PaletteWidget.cpp index 40ca90d24f..19c1ecbc8b 100644 --- a/Applications/PaintBrush/PaletteWidget.cpp +++ b/Applications/PaintBrush/PaletteWidget.cpp @@ -53,7 +53,7 @@ PaletteWidget::PaletteWidget(PaintableWidget& paintable_widget, GWidget* parent) set_background_color(Color::WarmGray); set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); - set_preferred_size({ 0, 34 }); + set_preferred_size(0, 34); m_secondary_color_widget = new GFrame(this); m_secondary_color_widget->set_frame_thickness(2); diff --git a/Applications/PaintBrush/ToolboxWidget.cpp b/Applications/PaintBrush/ToolboxWidget.cpp index 07475cd504..b4ea7a430b 100644 --- a/Applications/PaintBrush/ToolboxWidget.cpp +++ b/Applications/PaintBrush/ToolboxWidget.cpp @@ -41,7 +41,7 @@ ToolboxWidget::ToolboxWidget(GWidget* parent) set_frame_shadow(FrameShadow::Raised); set_size_policy(SizePolicy::Fixed, SizePolicy::Fill); - set_preferred_size({ 48, 0 }); + set_preferred_size(48, 0); set_layout(make<GBoxLayout>(Orientation::Vertical)); layout()->set_margins({ 4, 4, 4, 4 }); @@ -49,7 +49,7 @@ ToolboxWidget::ToolboxWidget(GWidget* parent) auto add_tool = [&](const StringView& name, const StringView& icon_name, OwnPtr<Tool>&& tool) { auto* button = new ToolButton(name, this, move(tool)); button->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); - button->set_preferred_size({ 0, 32 }); + button->set_preferred_size(0, 32); button->set_checkable(true); button->set_exclusive(true); |