on xenial help sign in
3 finger drag working \o/
commitadca54aa45c706e94dbcf1f33359c6f73686a521 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateMon 9 May 2016, 13:31 (10 years ago) parenta539be6
1 file changed+4−13
qml/Stages/WindowControlsOverlay.qml+4−13
qml/Stages/WindowControlsOverlay.qml+4−13
@@ -35,31 +35,24 @@ Item {
3535 minimumTouchPoints: 3
3636 maximumTouchPoints: minimumTouchPoints
3737 recognitionPeriod: 500
38− //releaseRejectPeriod: 500
3938
4039 readonly property bool recognizedPress: status == TouchGestureArea.Recognized &&
4140 touchPoints.length >= minimumTouchPoints &&
4241 touchPoints.length <= maximumTouchPoints
4342 onRecognizedPressChanged: {
4443 if (recognizedPress && target && !target.fullscreen) {
45− print("!!! RECOGNIZED")
4644 overlayTimer.start();
4745 }
4846 }
4947
5048 readonly property bool recognizedDrag: recognizedPress && dragging
5149 onRecognizedDragChanged: {
52− print("Dragging:", recognizedDrag);
53− priv.handlePressedChanged(recognizedDrag, center.x, center.y);
50+ priv.handlePressedChanged(recognizedDrag, tp.x, tp.y);
5451 }
5552
56− readonly property point center: Qt.point(touchPoints[0].x, touchPoints[0].y);
57− onCenterChanged: {
58− priv.handlePositionChanged(center.x, center.y)
59− }
60−
61− onStatusChanged: {
62− print("Status changed:", status)
53+ readonly property point tp: Qt.point(touchPoints[0].x, touchPoints[0].y);
54+ onUpdated: {
55+ priv.handlePositionChanged(tp.x, tp.y)
6356 }
6457 }
6558
@@ -83,7 +76,6 @@ Item {
8376 var pos = mapToItem(root.target, mouseX, mouseY);
8477 priv.distanceX = pos.x;
8578 priv.distanceY = pos.y;
86− print("SAVING POS", priv.distanceX, priv.distanceY)
8779 priv.dragging = true;
8880 } else {
8981 priv.dragging = false;
@@ -95,7 +87,6 @@ Item {
9587 var pos = mapToItem(root.target.parent, mouseX, mouseY);
9688 root.target.x = pos.x - priv.distanceX;
9789 root.target.y = Math.max(pos.y - priv.distanceY, PanelState.panelHeight);
98− print("MOVED TO", root.target.x, root.target.y)
9990 }
10091 }
10192 }