Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/code/layout.js
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | |||||
78 | function full() { | 78 | function full() { | ||
79 | return (maxStripes() == calculateStripes()); | 79 | return (maxStripes() == calculateStripes()); | ||
80 | } | 80 | } | ||
81 | 81 | | |||
82 | function optimumCapacity(width, height) { | 82 | function optimumCapacity(width, height) { | ||
83 | var length = tasks.vertical ? height : width; | 83 | var length = tasks.vertical ? height : width; | ||
84 | var maximum = tasks.vertical ? preferredMaxHeight() : preferredMaxWidth(); | 84 | var maximum = tasks.vertical ? preferredMaxHeight() : preferredMaxWidth(); | ||
85 | 85 | | |||
86 | return (Math.ceil(length / maximum) * maxStripes()); | 86 | if (!tasks.vertical) { | ||
87 | // Fit more tasks in this case, that is possible to cut text, before combining tasks. | ||||
88 | return Math.ceil(length / maximum) * maxStripes() + 1; | ||||
gvgeo: This has an effect mostly for small displays. On bigger displays this has a small effect.
If… | |||||
89 | } | ||||
90 | | ||||
91 | return Math.floor(length / maximum) * maxStripes(); | ||||
87 | } | 92 | } | ||
88 | 93 | | |||
89 | function layoutWidth() { | 94 | function layoutWidth() { | ||
90 | if (plasmoid.configuration.forceStripes && !tasks.vertical) { | 95 | if (plasmoid.configuration.forceStripes && !tasks.vertical) { | ||
91 | return Math.min(tasks.width, Math.max(preferredMaxWidth(), tasksPerStripe() * preferredMaxWidth())); | 96 | return Math.min(tasks.width, Math.max(preferredMaxWidth(), tasksPerStripe() * preferredMaxWidth())); | ||
92 | } else { | 97 | } else { | ||
93 | return tasks.width; | 98 | return tasks.width; | ||
94 | } | 99 | } | ||
▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines |
This has an effect mostly for small displays. On bigger displays this has a small effect.
If this is not by design could be instead: