Verified Commit 082a1bb3 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

[applets/showdesktop] Temporarily assume alt role when invoked from context menu

This patch makes is super-duper impossible to enable both effects at
once, and it does this by providing an obvious way to turn off the
currently active effect: just temporarily show on the main applet itself!

After ending the alternative effect, applet will naturally return to its
primary role, and both actions would still be available in the menu.
parent 60874595
Pipeline #232096 passed with stage
in 3 minutes and 1 second
......@@ -27,9 +27,19 @@ MouseArea {
readonly property Controller primaryController: isMinimizeAll ? minimizeAllController : peekController
readonly property Controller activeController: {
if (minimizeAllController.active) {
return minimizeAllController;
} else if (peekController.active) {
return peekController;
} else {
return primaryController;
}
}
Plasmoid.icon: Plasmoid.configuration.icon
Plasmoid.title: primaryController.title
Plasmoid.toolTipSubText: primaryController.description
Plasmoid.title: activeController.title
Plasmoid.toolTipSubText: activeController.description
Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
......@@ -43,7 +53,7 @@ MouseArea {
activeFocusOnTab: true
hoverEnabled: true
Plasmoid.onActivated: primaryController.toggle();
Plasmoid.onActivated: activeController.toggle();
onClicked: Plasmoid.activated();
Keys.onPressed: {
......@@ -71,7 +81,7 @@ MouseArea {
PlasmaCore.IconItem {
anchors.fill: parent
active: root.containsMouse || primaryController.active
active: root.containsMouse || activeController.active
source: Plasmoid.icon
}
......@@ -133,7 +143,7 @@ MouseArea {
}
return prefix;
}
opacity: primaryController.active ? 1 : 0
opacity: activeController.active ? 1 : 0
Behavior on opacity {
NumberAnimation {
......
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