diff --git a/applets/taskmanager/package/contents/code/layout.js b/applets/taskmanager/package/contents/code/layout.js
--- a/applets/taskmanager/package/contents/code/layout.js
+++ b/applets/taskmanager/package/contents/code/layout.js
@@ -17,6 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
+var iconSizes = ["small", "smallMedium", "medium", "large", "huge", "enormous"];
+
function horizontalMargins() {
return taskFrame.margins.left + taskFrame.margins.right;
}
@@ -132,7 +134,33 @@
}
function preferredMaxHeight() {
- return verticalMargins() + Math.min(units.iconSizes.small * 3, theme.mSize(theme.defaultFont).height * 3);
+ if (tasks.vertical) {
+ return verticalMargins()
+ + Math.min(
+ // Do not allow the preferred icon size to exceed the width of the vertical task manager.
+ tasks.width,
+ Math.max(
+ // This assumes that we show some text and that we need some minimal vertical space for it.
+ // In reality, we do not always show the text. We show the text only if there
+ // is enough horizontal space for some hard coded amount of 'm' characters
+ // - see minimumMColumns() below.
+ // Hence in case the user prefers icons smaller than the height of his font,
+ // the font height will win even if the text will stay invisible.
+ // We leave it for the future developers to improve this expresssion if the
+ // named corner case turns out to be important.
+ units.iconSizes[iconSizes[plasmoid.configuration.iconSize]],
+ theme.mSize(theme.defaultFont).height
+ )
+ );
+ } else {
+ return verticalMargins() + Math.min(units.iconSizes.small * 3, theme.mSize(theme.defaultFont).height * 3);
+ }
+}
+
+// Returns the number of 'm' characters whose joint width must be available in the task button label
+// so that the button text is rendered at all.
+function minimumMColumns() {
+ return tasks.vertical ? 3 : 5;
}
function taskWidth() {
diff --git a/applets/taskmanager/package/contents/config/main.xml b/applets/taskmanager/package/contents/config/main.xml
--- a/applets/taskmanager/package/contents/config/main.xml
+++ b/applets/taskmanager/package/contents/config/main.xml
@@ -93,6 +93,18 @@
true
+
+
+
+
+
+
+
+
+
+
+ 3
+
diff --git a/applets/taskmanager/package/contents/ui/ConfigGeneral.qml b/applets/taskmanager/package/contents/ui/ConfigGeneral.qml
--- a/applets/taskmanager/package/contents/ui/ConfigGeneral.qml
+++ b/applets/taskmanager/package/contents/ui/ConfigGeneral.qml
@@ -32,6 +32,7 @@
readonly property bool plasmaPaAvailable: Qt.createComponent("PulseAudio.qml").status === Component.Ready
property alias cfg_forceStripes: forceStripes.checked
+ property alias cfg_iconSize: iconSize.currentIndex
property alias cfg_showToolTips: showToolTips.checked
property alias cfg_wheelEnabled: wheelEnabled.checked
property alias cfg_highlightWindows: highlightWindows.checked
@@ -77,6 +78,18 @@
text: vertical ? i18n("Always arrange tasks in rows of as many columns") : i18n("Always arrange tasks in columns of as many rows")
enabled: maxStripes.value > 1
}
+
+ Label {
+ visible: vertical
+ text: i18n("Icon size")
+ }
+
+ ComboBox {
+ visible: vertical
+ id: iconSize
+ Layout.fillWidth: true
+ model: [i18n("Small"), i18n("Small Medium"), i18n("Medium"), i18n("Large"), i18n("Huge"), i18n("Enormous")]
+ }
}
}
diff --git a/applets/taskmanager/package/contents/ui/Task.qml b/applets/taskmanager/package/contents/ui/Task.qml
--- a/applets/taskmanager/package/contents/ui/Task.qml
+++ b/applets/taskmanager/package/contents/ui/Task.qml
@@ -474,7 +474,7 @@
id: label
visible: (inPopup || !iconsOnly && model.IsLauncher !== true
- && (parent.width - iconBox.height - units.smallSpacing) >= (theme.mSize(theme.defaultFont).width * 5))
+ && (parent.width - iconBox.height - units.smallSpacing) >= (theme.mSize(theme.defaultFont).width * minimumMColumns()))
anchors {
fill: parent