Merge lp:~nikwen/ubuntu-terminal-app/scrolling-improvements-2 into lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot

Proposed by Niklas Wenzel
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„
Approved revision: 93
Merged at revision: 94
Proposed branch: lp:~nikwen/ubuntu-terminal-app/scrolling-improvements-2
Merge into: lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot
Diff against target: 37 lines (+10/-8)
1 file modified
src/app/qml/TerminalInputArea.qml (+10/-8)
To merge this branch: bzr merge lp:~nikwen/ubuntu-terminal-app/scrolling-improvements-2
Reviewer Review Type Date Requested Status
Filippo Scognamiglio Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+262503@code.launchpad.net

Commit message

Detect whether the swipe is a swipe in x or y direction by comparing the length of the swipe in each direction instead of simply preferring y over x swipes

Description of the change

Detect whether the swipe is a swipe in x or y direction by comparing the length of the swipe in each direction instead of simply preferring y over x swipes.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Filippo Scognamiglio (flscogna) wrote :

Thank you very much for the patch Niklas. Looks really nice to me. :)

review: Approve
Revision history for this message
Niklas Wenzel (nikwen) wrote :

Thank you for merging it, Filippo. :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/app/qml/TerminalInputArea.qml'
--- src/app/qml/TerminalInputArea.qml 2015-06-14 15:42:15 +0000
+++ src/app/qml/TerminalInputArea.qml 2015-06-19 20:56:39 +0000
@@ -93,23 +93,25 @@
93 if (__multiTouch || multiTouchTimer.running) // Do not handle multi touch events here and detect multi touch swipes while the timer is running93 if (__multiTouch || multiTouchTimer.running) // Do not handle multi touch events here and detect multi touch swipes while the timer is running
94 return;94 return;
9595
96 var dragValue = touchPoints[0].y - __pressPosition.y;96 var dragValueY = touchPoints[0].y - __pressPosition.y;
97 var dragValueX = touchPoints[0].x - __pressPosition.x;97 var dragValueX = touchPoints[0].x - __pressPosition.x;
98 var dragSteps = dragValue / swipeDelta;98 var dragStepsY = dragValueY / swipeDelta;
99 var dragStepsX = dragValueX / swipeDelta;99 var dragStepsX = dragValueX / swipeDelta;
100100
101 var dragStepsFloorY = absFloor(dragSteps);101 var dragStepsFloorY = absFloor(dragStepsY);
102 var dragStepsFloorX = absFloor(dragStepsX);102 var dragStepsFloorX = absFloor(dragStepsX);
103103
104 if (!__moved && distance(touchPoints[0], __pressPosition) > swipeDelta)104 if (!__moved && distance(touchPoints[0], __pressPosition) > swipeDelta) {
105 __moved = true;105 __moved = true;
106 __dragging = (Math.abs(dragValueY) >= Math.abs(dragValueX)) ? yDragging : xDragging;
107 } else if (!__moved) {
108 return;
109 }
106110
107 if (__dragging !== xDragging && dragStepsFloorY !== __prevDragStepsY) {111 if (__dragging === yDragging && dragStepsFloorY !== __prevDragStepsY) {
108 swipeYDetected(dragStepsFloorY - __prevDragStepsY);112 swipeYDetected(dragStepsFloorY - __prevDragStepsY);
109 __dragging = yDragging;113 } else if (__dragging === xDragging && dragStepsFloorX !== __prevDragStepsX) {
110 } else if (__dragging !== yDragging && dragStepsFloorX !== __prevDragStepsX) {
111 swipeXDetected(dragStepsFloorX - __prevDragStepsX);114 swipeXDetected(dragStepsFloorX - __prevDragStepsX);
112 __dragging = xDragging;
113 }115 }
114116
115 __prevDragStepsY = dragStepsFloorY;117 __prevDragStepsY = dragStepsFloorY;

Subscribers

People subscribed via source and target branches