summaryrefslogtreecommitdiff
path: root/Services/Taskbar
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-29 18:44:59 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-30 01:28:28 +0100
commitc9331a96d6ff9270b0aa8aa543f784355a1a325e (patch)
tree7ed62aa058e3cbeb07b5c5689f13ede7a5bfb340 /Services/Taskbar
parent60e3f685dbcc3ef5cb4a3a7b141cbbb26ef4c4f0 (diff)
downloadserenity-c9331a96d6ff9270b0aa8aa543f784355a1a325e.zip
Taskbar: Set min/max size for taskbar buttons
This makes them shrink when the taskbar fills with too many buttons. It doesn't scale to infinity open windows, but it's better than them escaping off screen after 6 open windows. :^)
Diffstat (limited to 'Services/Taskbar')
-rw-r--r--Services/Taskbar/TaskbarWindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Services/Taskbar/TaskbarWindow.cpp b/Services/Taskbar/TaskbarWindow.cpp
index 2665a48216..de5d3d2a99 100644
--- a/Services/Taskbar/TaskbarWindow.cpp
+++ b/Services/Taskbar/TaskbarWindow.cpp
@@ -158,8 +158,9 @@ void TaskbarWindow::on_screen_rect_change(const Gfx::IntRect& rect)
NonnullRefPtr<GUI::Button> TaskbarWindow::create_button(const WindowIdentifier& identifier)
{
auto& button = main_widget()->add<TaskbarButton>(identifier);
- button.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
- button.set_preferred_size(140, 22);
+ button.set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fill);
+ button.set_min_size({ 20, 22 });
+ button.set_max_size({ 140, 22 });
button.set_text_alignment(Gfx::TextAlignment::CenterLeft);
button.set_icon(*m_default_icon);
return button;