@@ -35,12 +35,11 @@ Item {
35 minimumTouchPoints: 2
35 minimumTouchPoints: 2
36 maximumTouchPoints: minimumTouchPoints
36 maximumTouchPoints: minimumTouchPoints
37 recognitionPeriod: 500
37 recognitionPeriod: 500
38− releaseRejectPeriod: 500
38+ //releaseRejectPeriod: 500
40 readonly property bool recognizedPress: status == TouchGestureArea.Recognized &&
40 readonly property bool recognizedPress: status == TouchGestureArea.Recognized &&
41 touchPoints.length >= minimumTouchPoints &&
41 touchPoints.length >= minimumTouchPoints &&
42 touchPoints.length <= maximumTouchPoints
42 touchPoints.length <= maximumTouchPoints
44 onRecognizedPressChanged: {
43 onRecognizedPressChanged: {
45 if (recognizedPress && target && !target.fullscreen) {
44 if (recognizedPress && target && !target.fullscreen) {
46 print("!!! RECOGNIZED")
45 print("!!! RECOGNIZED")
@@ -48,6 +47,17 @@ Item {
50+ readonly property bool recognizedDrag: recognizedPress && dragging
51+ onRecognizedDragChanged: {
52+ print("Dragging:", recognizedDrag);
53+ priv.handlePressedChanged(recognizedDrag, center.x, center.y);
56+ readonly property point center: Qt.point(touchPoints[0].x, touchPoints[0].y);
58+ priv.handlePositionChanged(center.x, center.y)
51 onStatusChanged: {
61 onStatusChanged: {
52 print("Status changed:", status)
62 print("Status changed:", status)
@@ -67,6 +77,27 @@ Item {
67 property bool dragging
77 property bool dragging
69 readonly property var resizeArea: root.target && root.target.resizeArea ? root.target.resizeArea : null
79 readonly property var resizeArea: root.target && root.target.resizeArea ? root.target.resizeArea : null
81+ function handlePressedChanged(pressed, mouseX, mouseY) {
83+ var pos = mapToItem(root.target, mouseX, mouseY);
84+ print("SAVING POS", pos.x, pos.y)
85+ priv.distanceX = pos.x;
86+ priv.distanceY = pos.y;
87+ priv.dragging = true;
89+ priv.dragging = false;
93+ function handlePositionChanged(mouseX, mouseY) {
95+ var pos = mapToItem(root.target.parent, mouseX, mouseY);
96+ root.target.x = pos.x - priv.distanceX;
97+ root.target.y = Math.max(pos.y - priv.distanceY, PanelState.panelHeight);
98+ print("MOVED TO", root.target.x, root.target.y)
72 Binding {
103 Binding {
@@ -106,24 +137,8 @@ Item {
106 hoverEnabled: true
137 hoverEnabled: true
107 cursorShape: priv.dragging ? Qt.ClosedHandCursor : (overlay.visible ? Qt.OpenHandCursor : Qt.ArrowCursor)
138 cursorShape: priv.dragging ? Qt.ClosedHandCursor : (overlay.visible ? Qt.OpenHandCursor : Qt.ArrowCursor)
109− onPressedChanged: {
140+ onPressedChanged: priv.handlePressedChanged(pressed, mouseX, mouseY)
111− var pos = mapToItem(root.target, mouseX, mouseY);
112− priv.distanceX = pos.x;
113− priv.distanceY = pos.y;
114− priv.dragging = true;
116− priv.dragging = false;
120− onPositionChanged: {
141+ onPositionChanged: priv.handlePositionChanged(mouseX, mouseY)
121− if (priv.dragging) {
122− var pos = mapToItem(root.target.parent, mouseX, mouseY);
123− root.target.x = pos.x - priv.distanceX;
124− root.target.y = Math.max(pos.y - priv.distanceY, PanelState.panelHeight);
129 // dismiss area
144 // dismiss area