Commit ae8732ed authored by George Vogiatzis's avatar George Vogiatzis Committed by Nate Graham
Browse files

Don't compress tasks before grouping, when task manager is vertical

Summary:
Prevents compressing task's icons below the desired size, before grouping when vertical. While it allows to cut text when task bar is horizontal.
Gives a more uniform look and behavior, when the taskbar is vertical and icons determine the size of the task button.

Test Plan:
This patch, was original part of icons-only grouping change that would include "Group only when the Task Manager is full" option.
Would be more important in a docker style of task manager.

For now this patch can only have an effect when:
Group only when the Task Manager is full == True
Maximum rows = 1
Taskbar is vertical
Icon width > taskbar width (easiest to test with Icon size == large)

For more obvious effect, adjust the taskbar width, at a point where it will just display a bigger icon size.

In the same space, without the patch, it will display more items by choosing smaller icon size.
By opening more tasks (reach the task display threshold), will be forced to group them, and will pop to a bigger display icon size again.
With the patch will keep the desired icon size, and instead will group them together.
In both cases will shrink the icon sizes further if more tasks need to fit.

{F7816560}
In the photo can see,  the taskbar without the patch will fit the same amount of tasks, in a smaller space by displaying a smaller size.
After grouping will increase the size back again.

Reviewers: #plasma, #vdg, hein, ngraham

Reviewed By: #plasma, #vdg, hein, ngraham

Subscribers: davidedmundson, GB_2, ngraham, broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D25844
parent d11b8c9a
......@@ -83,7 +83,12 @@ function optimumCapacity(width, height) {
var length = tasks.vertical ? height : width;
var maximum = tasks.vertical ? preferredMaxHeight() : preferredMaxWidth();
return (Math.ceil(length / maximum) * maxStripes());
if (!tasks.vertical) {
// Fit more tasks in this case, that is possible to cut text, before combining tasks.
return Math.ceil(length / maximum) * maxStripes() + 1;
}
return Math.floor(length / maximum) * maxStripes();
}
function layoutWidth() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment