1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

GWidget: Add set_preferred_size(width, height) overload.

It was annoying to always write set_preferred_size({ width, height }). :^)
This commit is contained in:
Andreas Kling 2019-07-20 22:39:24 +02:00
parent 5b440a72f9
commit aa2224a2f0
26 changed files with 61 additions and 60 deletions

View file

@ -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);