on xenial help sign in
Choose more appropriate values for edge-drag gestures (LP: #1194150)

As suggested by Vesa Rautiainen. Fixes https://bugs.launchpad.net/touch-preview-images/+bug/1194150. Fixes: https://bugs.launchpad.net/bugs/1194150. Approved by Albert Astals Cid, PS Jenkins bot.

commit7c443336cc2de49be24a0a11a2a441828953357b authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateMon 1 Jul 2013, 15:47 (13 years ago) parent3c3f22b2be7d25
6 files changed+46−29
Bottombar/Bottombar.qml+1−8 Components/DragHandle.qml+1−8 Components/EdgeDragArea.qml+36 Components/Stage.qml+1−5 Launcher/Launcher.qml+1−8 debian/changelog+6
Bottombar/Bottombar.qml+1−8
@@ -64,7 +64,7 @@ Item {
6464 onShownChanged: bottomBarVisibilityCommunicatorShell.forceHidden = theHud.shown
6565 }
6666
67− DirectionalDragArea {
67+ EdgeDragArea {
6868 id: dragArea
6969 width: parent.width
7070 height: distanceThreshold
@@ -73,13 +73,6 @@ Item {
7373 enabled: !theHud.shown && bottombar.enabled && applicationIsOnForeground
7474 direction: Direction.Upwards
7575
76− // values to be tweaked and later removed from here and set in stone as defaults
77− // once we are confident it's all good.
78− maxDeviation: units.gu(1)
79− wideningAngle: 30
80− distanceThreshold: units.gu(3)
81− minSpeed: units.gu(5)
82−
8376 property int previousStatus: -1
8477 property real touchStartX: -1
8578
Components/DragHandle.qml+1−8
@@ -43,16 +43,9 @@ import Ubuntu.Gestures 0.1
4343 }
4444
4545 */
46−DirectionalDragArea {
46+EdgeDragArea {
4747 id: dragArea
4848
49− // Once we are satisfied with those values, make them the default
50− // and remove them from here for the sake of consistency
51− maxDeviation: units.gu(1)
52− wideningAngle: 20
53− distanceThreshold: units.gu(3)
54− minSpeed: units.gu(5)
55−
5649 // How far you can drag
5750 property real maxTotalDragDistance: Direction.isHorizontal(direction) ? parent.width : parent.height
5851
Components/EdgeDragArea.qmlnew file+36
@@ -0,0 +1,36 @@
1+/*
2+ * Copyright (C) 2013 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import Ubuntu.Components 0.1
19+import Ubuntu.Gestures 0.1
20+
21+/*
22+ A DirectionalDragArea wrapper that provides some well-chosen defaults
23+ for its gesture recognition parameters.
24+*/
25+DirectionalDragArea {
26+
27+ // TODO: Re-evaluate those or even the recognition heuristics itself once
28+ // we have gesture cancelling/forwarding in place.
29+ //
30+ // The idea here is that it's better having lax rules than false negatives.
31+ // False negatives are very frustrating to the user.
32+ maxDeviation: units.gu(3)
33+ wideningAngle: 50
34+ distanceThreshold: units.gu(1.5)
35+ minSpeed: units.gu(0) // some people were getting false negatives with it enabled.
36+}
Components/Stage.qml+1−5
@@ -423,7 +423,7 @@ Showable {
423423 maxDragDistance: stage.width
424424 }
425425
426− DirectionalDragArea {
426+ EdgeDragArea {
427427 id: rightEdgeDraggingArea
428428
429429 enabled: {
@@ -441,10 +441,6 @@ Showable {
441441 anchors.right: parent.right
442442
443443 direction: Direction.Leftwards
444− maxDeviation: units.gu(1)
445− wideningAngle: 20
446− distanceThreshold: units.gu(3)
447− minSpeed: units.gu(5)
448444
449445 onDistanceChanged: {
450446 if (status !== DirectionalDragArea.Recognized)
Launcher/Launcher.qml+1−8
@@ -181,18 +181,11 @@ Item {
181181 }
182182 }
183183
184− DirectionalDragArea {
184+ EdgeDragArea {
185185 id: dragArea
186186
187187 direction: Direction.Rightwards
188188
189− // values to be tweaked and later removed from here and set in stone as defaults
190− // once we are confident it's all good.
191− maxDeviation: units.gu(1)
192− wideningAngle: 30
193− distanceThreshold: units.gu(3)
194− minSpeed: units.gu(5)
195−
196189 enabled: root.available && root.state !== "visible"
197190 width: root.dragAreaWidth
198191 height: root.height
debian/changelog+6
@@ -1,3 +1,9 @@
1+unity8 (7.81.3) UNRELEASED; urgency=low
2+
3+ * Choose more appropriate values for edge-drag gestures (LP: #1194150)
4+
5+ -- Daniel d'Andrada <daniel.dandrada@canonical.com> Fri, 28 Jun 2013 16:28:24 -0300
6+
17unity8 (7.81.2) saucy; urgency=low
28
39 * Translation updates.