diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-05-09 03:06:20 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-09 03:06:20 +0200 |
commit | bffaa5ece6cb2cb4a82180efadb551516f5519da (patch) | |
tree | 489dc14c05a9bb36365fc0e5b268d7fd546e0192 /LibGUI/GFilePicker.cpp | |
parent | bd5c79aff2bb9e843179b881b59133660a4e3519 (diff) | |
download | serenity-bffaa5ece6cb2cb4a82180efadb551516f5519da.zip |
GLayout: Add a simple spacer concept; dummy item that expands-to-fit.
A spacer can be inserted anywhere in a layout and will simply expand to fill
the available space. This is useful for pushing widgets into place. :^)
Diffstat (limited to 'LibGUI/GFilePicker.cpp')
-rw-r--r-- | LibGUI/GFilePicker.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/LibGUI/GFilePicker.cpp b/LibGUI/GFilePicker.cpp index bf4c61c41d..8686997bf0 100644 --- a/LibGUI/GFilePicker.cpp +++ b/LibGUI/GFilePicker.cpp @@ -13,7 +13,7 @@ GFilePicker::GFilePicker(const String& path, CObject* parent) set_rect(200, 200, 400, 300); set_main_widget(new GWidget); main_widget()->set_layout(make<GBoxLayout>(Orientation::Vertical)); - main_widget()->layout()->set_margins({ 4, 0, 4, 0 }); + main_widget()->layout()->set_margins({ 4, 4, 4, 4 }); main_widget()->layout()->set_spacing(4); main_widget()->set_fill_with_background_color(true); main_widget()->set_background_color(Color::LightGray); @@ -42,6 +42,7 @@ GFilePicker::GFilePicker(const String& path, CObject* parent) button_container->set_preferred_size({ 0, 20 }); button_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); button_container->layout()->set_spacing(4); + button_container->layout()->add_spacer(); auto* cancel_button = new GButton(button_container); cancel_button->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill); |