From bb4d3e321edf57a529268516fa07a076b549eddd Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 5 Mar 2015 12:05:20 +0100 Subject: [PATCH] prototype for pressandhold --- containments/homescreen/contents/ui/HomeLauncher.qml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/containments/homescreen/contents/ui/HomeLauncher.qml b/containments/homescreen/contents/ui/HomeLauncher.qml index 1fccfbbb..045bfbfd 100644 --- a/containments/homescreen/contents/ui/HomeLauncher.qml +++ b/containments/homescreen/contents/ui/HomeLauncher.qml @@ -11,6 +11,17 @@ MouseArea { console.log("Clicked: " + model.ApplicationStorageIdRole) appListModel.runApplication(model.ApplicationStorageIdRole) } + onPressAndHold: { + root.drag.target = root; + } + onReleased: { + root.drag.target = null; + } + onPositionChanged: { + if (root.drag.target) { + print("New position: " +(Math.round(GridView.view.width / GridView.view.cellWidth) * Math.round(root.y / GridView.view.cellHeight) + Math.round(root.x / GridView.view.cellWidth))) + } + } PlasmaCore.IconItem { id: icon