Skip to content

Commit

Permalink
Taskbar: Set min/max size for taskbar buttons
Browse files Browse the repository at this point in the history
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. :^)
  • Loading branch information
awesomekling committed Dec 30, 2020
1 parent 60e3f68 commit c9331a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Services/Taskbar/TaskbarWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c9331a9

Please sign in to comment.