diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2022-07-27 07:45:54 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-08-04 02:56:17 +0200 |
commit | 1084eaea0b053485bbecf781e7b7028685d72427 (patch) | |
tree | 190d680e76b572d29e933fb06162dc88c3f0ba54 /Userland/Libraries/LibGUI/Toolbar.cpp | |
parent | 99a00dc39b67c5862331f2533e928dcb952cc4c6 (diff) | |
download | serenity-1084eaea0b053485bbecf781e7b7028685d72427.zip |
LibGUI: Remove button padding on Toolbar construction
And assume 24x24 button sizes by default.
There currently aren't any toolbars with custom button sizes, but if
the need arises, they can always determine their own padding.
Diffstat (limited to 'Userland/Libraries/LibGUI/Toolbar.cpp')
-rw-r--r-- | Userland/Libraries/LibGUI/Toolbar.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibGUI/Toolbar.cpp b/Userland/Libraries/LibGUI/Toolbar.cpp index 0f4c3769ea..be7e10e71b 100644 --- a/Userland/Libraries/LibGUI/Toolbar.cpp +++ b/Userland/Libraries/LibGUI/Toolbar.cpp @@ -26,11 +26,11 @@ Toolbar::Toolbar(Orientation orientation, int button_size) : m_orientation(orientation) , m_button_size(button_size) { - if (m_orientation == Orientation::Horizontal) { - set_fixed_height(button_size + 8); - } else { - set_fixed_width(button_size + 8); - } + if (m_orientation == Orientation::Horizontal) + set_fixed_height(button_size); + else + set_fixed_width(button_size); + set_layout<BoxLayout>(orientation); layout()->set_spacing(0); layout()->set_margins({ 2, 2, 2, 2 }); @@ -96,7 +96,7 @@ ErrorOr<NonnullRefPtr<GUI::Button>> Toolbar::try_add_action(Action& action) TRY(m_items.try_ensure_capacity(m_items.size() + 1)); auto button = TRY(try_add<ToolbarButton>(action)); - button->set_fixed_size(m_button_size + 8, m_button_size + 8); + button->set_fixed_size(m_button_size, m_button_size); m_items.unchecked_append(move(item)); return button; |