on xenial help sign in
3 finger drag working \o/
adca54aLukáš Tinkl
qml/Stages/WindowControlsOverlay.qml+4−13
@@ -35,31 +35,24 @@ Item {
35 minimumTouchPoints: 3
35 minimumTouchPoints: 3
36 maximumTouchPoints: minimumTouchPoints
36 maximumTouchPoints: minimumTouchPoints
37 recognitionPeriod: 500
37 recognitionPeriod: 500
38− //releaseRejectPeriod: 500
39
38
40 readonly property bool recognizedPress: status == TouchGestureArea.Recognized &&
39 readonly property bool recognizedPress: status == TouchGestureArea.Recognized &&
41 touchPoints.length >= minimumTouchPoints &&
40 touchPoints.length >= minimumTouchPoints &&
42 touchPoints.length <= maximumTouchPoints
41 touchPoints.length <= maximumTouchPoints
43 onRecognizedPressChanged: {
42 onRecognizedPressChanged: {
44 if (recognizedPress && target && !target.fullscreen) {
43 if (recognizedPress && target && !target.fullscreen) {
45− print("!!! RECOGNIZED")
46 overlayTimer.start();
44 overlayTimer.start();
47 }
45 }
48 }
46 }
49
47
50 readonly property bool recognizedDrag: recognizedPress && dragging
48 readonly property bool recognizedDrag: recognizedPress && dragging
51 onRecognizedDragChanged: {
49 onRecognizedDragChanged: {
52− print("Dragging:", recognizedDrag);
53− priv.handlePressedChanged(recognizedDrag, center.x, center.y);
50+ priv.handlePressedChanged(recognizedDrag, tp.x, tp.y);
54 }
51 }
55
52
56− readonly property point center: Qt.point(touchPoints[0].x, touchPoints[0].y);
53+ readonly property point tp: Qt.point(touchPoints[0].x, touchPoints[0].y);
57− onCenterChanged: {
54+ onUpdated: {
58− priv.handlePositionChanged(center.x, center.y)
55+ priv.handlePositionChanged(tp.x, tp.y)
59− }
60−
61− onStatusChanged: {
62− print("Status changed:", status)
63 }
56 }
64 }
57 }
65
58
@@ -83,7 +76,6 @@ Item {
83 var pos = mapToItem(root.target, mouseX, mouseY);
76 var pos = mapToItem(root.target, mouseX, mouseY);
84 priv.distanceX = pos.x;
77 priv.distanceX = pos.x;
85 priv.distanceY = pos.y;
78 priv.distanceY = pos.y;
86− print("SAVING POS", priv.distanceX, priv.distanceY)
87 priv.dragging = true;
79 priv.dragging = true;
88 } else {
80 } else {
89 priv.dragging = false;
81 priv.dragging = false;
@@ -95,7 +87,6 @@ Item {
95 var pos = mapToItem(root.target.parent, mouseX, mouseY);
87 var pos = mapToItem(root.target.parent, mouseX, mouseY);
96 root.target.x = pos.x - priv.distanceX;
88 root.target.x = pos.x - priv.distanceX;
97 root.target.y = Math.max(pos.y - priv.distanceY, PanelState.panelHeight);
89 root.target.y = Math.max(pos.y - priv.distanceY, PanelState.panelHeight);
98− print("MOVED TO", root.target.x, root.target.y)
99 }
90 }
100 }
91 }
101 }
92 }