mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:37:34 +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
|
@ -34,7 +34,7 @@ int main(int argc, char** argv)
|
|||
label->set_font(Font::default_bold_font());
|
||||
label->set_text("Serenity Operating System");
|
||||
label->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||
label->set_preferred_size({ 0, 11 });
|
||||
label->set_preferred_size(0, 11);
|
||||
|
||||
utsname uts;
|
||||
int rc = uname(&uts);
|
||||
|
@ -43,12 +43,12 @@ int main(int argc, char** argv)
|
|||
auto* version_label = new GLabel(widget);
|
||||
version_label->set_text(String::format("Version %s", uts.release));
|
||||
version_label->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||
version_label->set_preferred_size({ 0, 11 });
|
||||
version_label->set_preferred_size(0, 11);
|
||||
|
||||
auto* quit_button = new GButton(widget);
|
||||
quit_button->set_text("Okay");
|
||||
quit_button->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
|
||||
quit_button->set_preferred_size({ 100, 20 });
|
||||
quit_button->set_preferred_size(100, 20);
|
||||
quit_button->on_click = [](GButton&) {
|
||||
GApplication::the().quit(0);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue