From 9cd3635114e6cc34e4fd9df02885efeac00ecf2c Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 10 Jun 2015 16:43:10 -0700 Subject: [PATCH] feedback when clicking on a launcher icon --- .../homescreen/package/contents/ui/main.qml | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/containments/homescreen/package/contents/ui/main.qml b/containments/homescreen/package/contents/ui/main.qml index 18b6d556..8fd73a86 100644 --- a/containments/homescreen/package/contents/ui/main.qml +++ b/containments/homescreen/package/contents/ui/main.qml @@ -230,8 +230,10 @@ MouseEventListener { dragDelegate.xTarget = Math.floor(mouse.x / root.buttonHeight) * root.buttonHeight; dragDelegate.yTarget = Math.floor(mouse.y / root.buttonHeight) * root.buttonHeight; dragDelegate.opacity = 0; - dragDelegate.modelData.ApplicationIconRole = ""; - dragDelegate.modelDataChanged(); + if (dragDelegate.modelData) { + dragDelegate.modelData.ApplicationIconRole = ""; + dragDelegate.modelDataChanged(); + } applicationsView.dragData = null; root.reorderingApps = false; applicationsView.forceLayout(); @@ -241,6 +243,7 @@ MouseEventListener { } onClicked: { var pos = mapToItem(applicationsView.headerItem.favoritesStrip, mouse.x, mouse.y); + //in favorites area? var item; if (applicationsView.headerItem.favoritesStrip.contains(pos)) { @@ -253,7 +256,30 @@ MouseEventListener { return; } - plasmoid.nativeInterface.applicationListModel.runApplication(item.modelData.ApplicationStorageIdRole) + plasmoid.nativeInterface.applicationListModel.runApplication(item.modelData.ApplicationStorageIdRole); + clickFedbackAnimation.target = item; + clickFedbackAnimation.running = true; + } + SequentialAnimation { + id: clickFedbackAnimation + property Item target + NumberAnimation { + target: clickFedbackAnimation.target + properties: "scale" + to: 2 + duration: units.longDuration + easing.type: Easing.InOutQuad + } + PauseAnimation { + duration: units.shortDuration + } + NumberAnimation { + target: clickFedbackAnimation.target + properties: "scale" + to: 1 + duration: units.longDuration + easing.type: Easing.InOutQuad + } } PlasmaCore.ColorScope { anchors.fill: parent