@@ -17,17 +17,19 @@
17import QtQuick 2.4
17import QtQuick 2.4
18import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
19import Ubuntu.Gestures 0.1
19import Ubuntu.Gestures 0.1
20+import "../Components/PanelState"
22 // to be set from outside
24 // to be set from outside
23 property Item target // appDelegate
25 property Item target // appDelegate
24 property int borderThickness
26 property int borderThickness
26 TabletSideStageTouchGesture {
28 TabletSideStageTouchGesture {
27 id: gestureArea
29 id: gestureArea
28 minimumTouchPoints: 2
31 minimumTouchPoints: 2
29 maximumTouchPoints: 2
32 maximumTouchPoints: 2
32 onRecognisedPressChanged: {
34 onRecognisedPressChanged: {
33 print("Press recognized:", recognisedPress)
35 print("Press recognized:", recognisedPress)
@@ -38,9 +40,8 @@ Item {
38 onRecognisedDragChanged: {
40 onRecognisedDragChanged: {
39 print("Drag recognized:", recognisedDrag)
41 print("Drag recognized:", recognisedDrag)
41− onDragStarted: print("Drag started")
43+ onPressed: print("Pressed:", x, y)
42 onDropped: print("Dropped")
44 onDropped: print("Dropped")
43− onCancelled: print("Cancelled")
46 Timer { // dismiss timer
47 Timer { // dismiss timer
@@ -53,6 +54,38 @@ Item {
53 onClicked: overlayTimer.stop()
54 onClicked: overlayTimer.stop()
59+ property real distanceX
60+ property real distanceY
61+ property bool dragging
66+ visible: overlay.visible
71+ var pos = mapToItem(root.target, mouseX, mouseY);
72+ priv.distanceX = pos.x;
73+ priv.distanceY = pos.y;
74+ priv.dragging = true;
76+ priv.dragging = false;
82+ var pos = mapToItem(root.target.parent, mouseX, mouseY);
83+ root.target.x = pos.x - priv.distanceX;
84+ root.target.y = Math.max(pos.y - priv.distanceY, PanelState.panelHeight);
57 id: overlay
90 id: overlay
58 anchors.fill: parent
91 anchors.fill: parent