diff --git a/applets/taskmanager/package/contents/ui/Task.qml b/applets/taskmanager/package/contents/ui/Task.qml index 6347c8d5564e6d7b20558d00a5cc0932a3aa8acd..f54c37bb26fb0f5df46280634fc74c13b64d08c9 100644 --- a/applets/taskmanager/package/contents/ui/Task.qml +++ b/applets/taskmanager/package/contents/ui/Task.qml @@ -5,6 +5,7 @@ */ import QtQuick 2.0 +import QtGraphicalEffects 1.12 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents @@ -415,13 +416,53 @@ MouseArea { PlasmaCore.IconItem { id: icon - anchors.fill: parent + anchors { + centerIn: parent + verticalCenterOffset: m.IsGroupParent === true && !taskSvg.hasExpanderGraphics ? Math.round(PlasmaCore.Units.smallSpacing/2) : 0 + horizontalCenterOffset: m.IsGroupParent === true && !taskSvg.hasExpanderGraphics ? -Math.round(PlasmaCore.Units.smallSpacing/2) : 0 + } + width: parent.width + height: parent.height active: task.highlighted enabled: true usesPlasmaTheme: false source: model.decoration + + // Shadow behind this icon when showing another copy behind it when + // using Plasma themes that don't have their own grouped task icon + layer.enabled: m.IsGroupParent === true && !taskSvg.hasExpanderGraphics + layer.effect: DropShadow { + cached: true + color: "dimgray" + samples: 7 // 2 fewer than default to reduce resource use + horizontalOffset: 1 + verticalOffset: -1 + } + } + + // Secondary icon behind the first one for grouped tasks when using + // Plasma themes that don't have their own grouped task icon + Loader { + anchors { + centerIn: parent + verticalCenterOffset: -Math.round(PlasmaCore.Units.smallSpacing/2) + horizontalCenterOffset: Math.round(PlasmaCore.Units.smallSpacing/2) + } + width: parent.width + height: parent.height + z: -1 + + active: m.IsGroupParent === true && !taskSvg.hasExpanderGraphics + sourceComponent: PlasmaCore.IconItem { + active: task.highlighted + enabled: true + opacity: 0.7 + usesPlasmaTheme: false + + source: model.decoration + } } Loader { @@ -562,7 +603,7 @@ MouseArea { ] Component.onCompleted: { - if (!inPopup && model.IsWindow === true) { + if (!inPopup && model.IsWindow === true && taskSvg.hasExpanderGraphics) { var component = Qt.createComponent("GroupExpanderOverlay.qml"); component.createObject(task); } diff --git a/applets/taskmanager/package/contents/ui/main.qml b/applets/taskmanager/package/contents/ui/main.qml index 7ae148ec8dbb26b5bbbdda3038580da308367eb0..cbb1f4bf1bd4f4bd13eb8b7b39f0a658a978d2b7 100644 --- a/applets/taskmanager/package/contents/ui/main.qml +++ b/applets/taskmanager/package/contents/ui/main.qml @@ -378,6 +378,11 @@ MouseArea { PlasmaCore.Svg { id: taskSvg + readonly property bool hasExpanderGraphics: hasElement("group-expander-left") + && hasElement("group-expander-right") + && hasElement("group-expander-top") + && hasElement("group-expander-bottom") + imagePath: "widgets/tasks" }