Commit 27fa3f7e authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

systray: show a small animation on the icons when activated

Summary: Both for plasmoids and SNI

Test Plan: Now there's some kind of feedback when pressing the icons

Reviewers: #plasma, ngraham

Reviewed By: ngraham

Subscribers: filipf, broulik, anthonyfieroni, davidedmundson, ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D19947
parent c3242c1d
......@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.1
import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
......@@ -102,8 +102,32 @@ PlasmaCore.ToolTipArea {
units.longDuration > 0
}
function activated() {
activatedAnimation.start()
}
SequentialAnimation {
id: activatedAnimation
loops: 1
ScaleAnimator {
target: iconItem
from: 1
to: 0.5
duration: units.shortDuration
easing.type: Easing.InQuad
}
ScaleAnimator {
target: iconItem
from: 0.5
to: 1
duration: units.shortDuration
easing.type: Easing.OutQuad
}
}
MouseArea {
id: mouseArea
anchors.fill: abstractItem
hoverEnabled: true
drag.filterChildren: true
......
......@@ -66,6 +66,8 @@ AbstractItem {
}
Connections {
target: applet
onActivated: plasmoidContainer.activated()
onExpandedChanged: {
if (expanded) {
var oldApplet = root.activeApplet;
......@@ -74,6 +76,7 @@ AbstractItem {
oldApplet.expanded = false;
}
dialog.visible = true;
plasmoidContainer.activated()
} else if (root.activeApplet === applet) {
if (!applet.parent.hidden) {
......
......@@ -90,6 +90,7 @@ AbstractItem {
openContextMenu(pos);
}
});
taskIcon.activated()
break;
}
case Qt.RightButton:
......@@ -103,6 +104,7 @@ AbstractItem {
operation.y = pos.y;
service.startOperationCall(operation);
taskIcon.activated()
break;
}
}
......
Markdown is supported
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