Commit 95acde4c authored by Nate Graham's avatar Nate Graham
Browse files

applets/showdesktop: Give it an active indicator line

This way it shows when its effect is active, just like the Minimize All
applet does.

BUG: 447998
FIXED-IN: 5.24.2


(cherry picked from commit c9f9713b)
parent 542e9a24
Pipeline #138370 canceled with stage
...@@ -37,6 +37,8 @@ QtObject { ...@@ -37,6 +37,8 @@ QtObject {
} }
Plasmoid.fullRepresentation: PlasmaCore.ToolTipArea { Plasmoid.fullRepresentation: PlasmaCore.ToolTipArea {
id: fullRep
readonly property bool inPanel: (plasmoid.location === PlasmaCore.Types.TopEdge readonly property bool inPanel: (plasmoid.location === PlasmaCore.Types.TopEdge
|| plasmoid.location === PlasmaCore.Types.RightEdge || plasmoid.location === PlasmaCore.Types.RightEdge
|| plasmoid.location === PlasmaCore.Types.BottomEdge || plasmoid.location === PlasmaCore.Types.BottomEdge
...@@ -74,6 +76,59 @@ QtObject { ...@@ -74,6 +76,59 @@ QtObject {
onTriggered: plasmoid.activated() onTriggered: plasmoid.activated()
} }
} }
}
// Active/not active indicator
PlasmaCore.FrameSvgItem {
property var containerMargins: {
let item = fullRep;
while (item.parent) {
item = item.parent;
if (item.isAppletContainer) {
return item.getMargins;
}
}
return undefined;
}
anchors {
fill: parent
property bool returnAllMargins: true
// The above makes sure margin is returned even for side margins
// that would be otherwise turned off.
bottomMargin: containerMargins ? -containerMargins('bottom', returnAllMargins) : 0;
topMargin: containerMargins ? -containerMargins('top', returnAllMargins) : 0;
leftMargin: containerMargins ? -containerMargins('left', returnAllMargins) : 0;
rightMargin: containerMargins ? -containerMargins('right', returnAllMargins) : 0;
}
imagePath: "widgets/tabbar"
visible: fromCurrentTheme && opacity > 0
prefix: {
var prefix;
switch (plasmoid.location) {
case PlasmaCore.Types.LeftEdge:
prefix = "west-active-tab";
break;
case PlasmaCore.Types.TopEdge:
prefix = "north-active-tab";
break;
case PlasmaCore.Types.RightEdge:
prefix = "east-active-tab";
break;
default:
prefix = "south-active-tab";
}
if (!hasElementPrefix(prefix)) {
prefix = "active-tab";
}
return prefix;
}
opacity: showdesktop.showingDesktop ? 1 : 0
Behavior on opacity {
NumberAnimation {
duration: PlasmaCore.Units.shortDuration
easing.type: Easing.InOutQuad
}
}
}
}
} }
Supports Markdown
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