prototype for pressandhold

This commit is contained in:
Marco Martin 2015-03-05 12:05:20 +01:00
parent 6e09e7d877
commit bb4d3e321e

View file

@ -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