Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/touchPoints into lp:ubuntu-ui-toolkit/staging

Proposed by Cris Dywan
Status: Merged
Approved by: Tim Peeters
Approved revision: 1794
Merged at revision: 1924
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/touchPoints
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 122 lines (+20/-20)
1 file modified
src/Ubuntu/Components/1.3/InputHandler.qml (+20/-20)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/touchPoints
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Tim Peeters Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+281500@code.launchpad.net

Commit message

Don't use a separate argument to distinguish touch events

If it's touch, it has our overloaded methods

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :

FAILED: Autolanding.
Approved revid is not set in launchpad. This is most likely a launchpad issue and re-approve should fix it. There is also a chance (although a very small one) this is a permission problem of the ps-jenkins bot.
https://jenkins.ubuntu.com/ubuntu-sdk/job/ubuntu-ui-toolkit-autolanding/2/
Executed test runs:
    None: https://jenkins.ubuntu.com/ubuntu-sdk/job/generic-land-mp/2/console

review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :

FAILED: Autolanding.
Approved revid is not set in launchpad. This is most likely a launchpad issue and re-approve should fix it. There is also a chance (although a very small one) this is a permission problem of the ps-jenkins bot.
https://jenkins.ubuntu.com/ubuntu-sdk/job/ubuntu-ui-toolkit-autolanding/17/
Executed test runs:
    None: https://jenkins.ubuntu.com/ubuntu-sdk/job/generic-land-mp/17/console

review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

The upcoming CI test results are a result of experimenting only, please ignore.

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

(CI experimentation done, all ok)

Revision history for this message
Tim Peeters (tpeeters) wrote :

Changes look good.

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Components/1.3/InputHandler.qml'
2--- src/Ubuntu/Components/1.3/InputHandler.qml 2015-11-20 15:18:50 +0000
3+++ src/Ubuntu/Components/1.3/InputHandler.qml 2016-01-04 09:55:56 +0000
4@@ -147,7 +147,7 @@
5 return p;
6 }
7 // focuses the input if not yet focused, and shows the context menu
8- function openContextMenu(mouse, noAutoselect, fromTouch) {
9+ function openContextMenu(mouse, noAutoselect) {
10 var pos = mousePosition(mouse);
11 if (!main.focus || !mouseInSelection(mouse)) {
12 activateInput();
13@@ -157,7 +157,7 @@
14 }
15 }
16 // open context menu at the cursor position
17- inputHandler.pressAndHold(input.cursorPosition, fromTouch);
18+ inputHandler.pressAndHold(input.cursorPosition, mouse.touch);
19 // if opened with left press (touch falls into this criteria as well), we need to set state to inactive
20 // so the mouse moves won't result in selected text loss/change
21 if (mouse.button === Qt.LeftButton) {
22@@ -341,8 +341,8 @@
23 }
24
25 // touch and mous handling
26- function handlePressed(event, touch) {
27- if (touch) {
28+ function handlePressed(event) {
29+ if (event.touch) {
30 // we do not have longTap or double tap, therefore we need to generate those
31 event.touch();
32 } else {
33@@ -352,8 +352,8 @@
34 // remember pressed position as we need it when entering into selection state
35 pressedPosition = mousePosition(event);
36 }
37- function handleReleased(event, touch) {
38- if (touch) {
39+ function handleReleased(event) {
40+ if (event.touch) {
41 event.untouch();
42 }
43 if ((!main.focus && !main.activeFocusOnPress) || suppressReleaseEvent === true) {
44@@ -362,7 +362,7 @@
45 }
46
47 activateInput();
48- if (state === "" || touch) {
49+ if (state === "" || event.touch) {
50 input.cursorPosition = mousePosition(event);
51 }
52 moveStarts = moveEnds = -1;
53@@ -370,21 +370,21 @@
54 // check if we get right-click from the frame or the area that has no text
55 if (event.button === Qt.RightButton) {
56 // open the popover
57- inputHandler.pressAndHold(input.cursorPosition, touch);
58+ inputHandler.pressAndHold(input.cursorPosition, event.touch);
59 } else {
60 inputHandler.tap(input.cursorPosition);
61 }
62 }
63- function handleMove(event, touch ) {
64+ function handleMove(event) {
65 // leave if not focus, not the left button or not in select state
66- if (!input.activeFocus || (!touch && event.button !== Qt.LeftButton) || !main.selectByMouse) {
67+ if (!input.activeFocus || (!event.touch && event.button !== Qt.LeftButton) || !main.selectByMouse) {
68 return;
69 }
70 selectText(event);
71 }
72- function handleDblClick(event, touch) {
73+ function handleDblClick(event) {
74 if (main.selectByMouse) {
75- openContextMenu(event, false, touch);
76+ openContextMenu(event, false);
77 // turn selection state temporarily so the selection is not cleared on release
78 state = "selection";
79 suppressReleaseEvent = true;
80@@ -393,17 +393,17 @@
81
82 // Mouse handling
83 Mouse.forwardTo: [main]
84- Mouse.onPressed: handlePressed(mouse, false)
85- Mouse.onReleased: handleReleased(mouse, false)
86- Mouse.onPositionChanged: handleMove(mouse, false)
87- Mouse.onDoubleClicked: handleDblClick(mouse, false)
88+ Mouse.onPressed: handlePressed(mouse)
89+ Mouse.onReleased: handleReleased(mouse)
90+ Mouse.onPositionChanged: handleMove(mouse)
91+ Mouse.onDoubleClicked: handleDblClick(mouse)
92
93 // right button handling
94 MouseArea {
95 anchors.fill: parent
96 acceptedButtons: Qt.RightButton
97 // trigger pressAndHold
98- onReleased: openContextMenu(mouse, true, false)
99+ onReleased: openContextMenu(mouse, true)
100 cursorShape: Qt.IBeamCursor
101 }
102 Keys.onMenuPressed: inputHandler.pressAndHold(input.cursorPosition, false);
103@@ -442,7 +442,7 @@
104 if (touchPoint.startY - touchPoint.y < -units.gu(2))
105 return;
106
107- openContextMenu(touchPoint, false, true);
108+ openContextMenu(touchPoint, false);
109 suppressReleaseEvent = true;
110 }
111 }
112@@ -456,8 +456,8 @@
113 tapCount = running;
114 }
115 }
116- onPressed: handlePressed(touchPoints[0], true)
117- onReleased: handleReleased(touchPoints[0], true)
118+ onPressed: handlePressed(touchPoints[0])
119+ onReleased: handleReleased(touchPoints[0])
120
121 property Item cursorPositionCursor: null
122 property Item selectionStartCursor: null

Subscribers

People subscribed via source and target branches