From 341ba05f88c8ef7475f89bd29b6479b5081be678 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 10 Feb 2019 18:07:11 +0200 Subject: [PATCH] use correct plasma style for applets --- .../ui/applet/indicators/PlasmaIndicator.qml | 59 ++++++++----------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/containment/package/contents/ui/applet/indicators/PlasmaIndicator.qml b/containment/package/contents/ui/applet/indicators/PlasmaIndicator.qml index 6b64f9b62..62d808bec 100644 --- a/containment/package/contents/ui/applet/indicators/PlasmaIndicator.qml +++ b/containment/package/contents/ui/applet/indicators/PlasmaIndicator.qml @@ -24,51 +24,44 @@ import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.latte 0.2 as Latte PlasmaCore.FrameSvgItem { - id: frame + id: expandedItem anchors.fill: parent - - imagePath: "widgets/tasks" - - property bool isActive: (appletItem.isExpanded - && communicator.overlayLatteIconIsActive - && !appletItem.isSystray - && applet.pluginName !== root.plasmoidName - && applet.pluginName !== "org.kde.activeWindowControl" - && applet.pluginName !== "org.kde.plasma.appmenu") - - - property string basePrefix: "" - - prefix: taskPrefix(basePrefix) - - function taskPrefix(prefix) { - var effectivePrefix; - + imagePath: "widgets/tabbar" + visible: opacity > 0 + prefix: { + var prefix; switch (plasmoid.location) { case PlasmaCore.Types.LeftEdge: - effectivePrefix = "west-" + prefix; + prefix = "west-active-tab"; break; case PlasmaCore.Types.TopEdge: - effectivePrefix = "north-" + prefix; + prefix = "north-active-tab"; break; case PlasmaCore.Types.RightEdge: - effectivePrefix = "east-" + prefix; + prefix = "east-active-tab"; break; default: - effectivePrefix = "south-" + prefix; + prefix = "south-active-tab"; + } + if (!hasElementPrefix(prefix)) { + prefix = "active-tab"; } - return [effectivePrefix, prefix]; + return prefix; } - states: [ - State { - name: "active" - when: frame.isActive + opacity: isActive ? 1 : 0 - PropertyChanges { - target: frame - basePrefix: "focus" - } + property bool isActive: (appletItem.isExpanded + && communicator.overlayLatteIconIsActive + && !appletItem.isSystray + && applet.pluginName !== root.plasmoidName + && applet.pluginName !== "org.kde.activeWindowControl" + && applet.pluginName !== "org.kde.plasma.appmenu") + + Behavior on opacity { + NumberAnimation { + duration: units.shortDuration + easing.type: Easing.InOutQuad } - ] + } }