mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +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:
parent
5b440a72f9
commit
aa2224a2f0
26 changed files with 61 additions and 60 deletions
|
@ -8,7 +8,7 @@ GToolBar::GToolBar(GWidget* parent)
|
|||
: GWidget(parent)
|
||||
{
|
||||
set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||
set_preferred_size({ 0, 28 });
|
||||
set_preferred_size(0, 28);
|
||||
set_layout(make<GBoxLayout>(Orientation::Horizontal));
|
||||
layout()->set_spacing(0);
|
||||
layout()->set_margins({ 2, 2, 2, 2 });
|
||||
|
@ -39,7 +39,7 @@ void GToolBar::add_action(GAction& action)
|
|||
button->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
|
||||
ASSERT(button->size_policy(Orientation::Horizontal) == SizePolicy::Fixed);
|
||||
ASSERT(button->size_policy(Orientation::Vertical) == SizePolicy::Fixed);
|
||||
button->set_preferred_size({ 24, 24 });
|
||||
button->set_preferred_size(24, 24);
|
||||
|
||||
m_items.append(move(item));
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public:
|
|||
{
|
||||
set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
|
||||
set_background_color(Color::White);
|
||||
set_preferred_size({ 8, 22 });
|
||||
set_preferred_size(8, 22);
|
||||
}
|
||||
virtual ~SeparatorWidget() override {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue