on xenial help sign in
Choose more appropriate values for edge-drag gestures (LP: #1194150)
7c44333Daniel d'Andrada
Bottombar/Bottombar.qml+1−8
@@ -64,7 +64,7 @@ Item {
64 onShownChanged: bottomBarVisibilityCommunicatorShell.forceHidden = theHud.shown
64 onShownChanged: bottomBarVisibilityCommunicatorShell.forceHidden = theHud.shown
65 }
65 }
66
66
67− DirectionalDragArea {
67+ EdgeDragArea {
68 id: dragArea
68 id: dragArea
69 width: parent.width
69 width: parent.width
70 height: distanceThreshold
70 height: distanceThreshold
@@ -73,13 +73,6 @@ Item {
73 enabled: !theHud.shown && bottombar.enabled && applicationIsOnForeground
73 enabled: !theHud.shown && bottombar.enabled && applicationIsOnForeground
74 direction: Direction.Upwards
74 direction: Direction.Upwards
75
75
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−
83 property int previousStatus: -1
76 property int previousStatus: -1
84 property real touchStartX: -1
77 property real touchStartX: -1
85
78
Components/DragHandle.qml+1−8
@@ -43,16 +43,9 @@ import Ubuntu.Gestures 0.1
43 }
43 }
44
44
45 */
45 */
46−DirectionalDragArea {
46+EdgeDragArea {
47 id: dragArea
47 id: dragArea
48
48
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−
56 // How far you can drag
49 // How far you can drag
57 property real maxTotalDragDistance: Direction.isHorizontal(direction) ? parent.width : parent.height
50 property real maxTotalDragDistance: Direction.isHorizontal(direction) ? parent.width : parent.height
58
51
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 {
423 maxDragDistance: stage.width
423 maxDragDistance: stage.width
424 }
424 }
425
425
426− DirectionalDragArea {
426+ EdgeDragArea {
427 id: rightEdgeDraggingArea
427 id: rightEdgeDraggingArea
428
428
429 enabled: {
429 enabled: {
@@ -441,10 +441,6 @@ Showable {
441 anchors.right: parent.right
441 anchors.right: parent.right
442
442
443 direction: Direction.Leftwards
443 direction: Direction.Leftwards
444− maxDeviation: units.gu(1)
445− wideningAngle: 20
446− distanceThreshold: units.gu(3)
447− minSpeed: units.gu(5)
448
444
449 onDistanceChanged: {
445 onDistanceChanged: {
450 if (status !== DirectionalDragArea.Recognized)
446 if (status !== DirectionalDragArea.Recognized)
Launcher/Launcher.qml+1−8
@@ -181,18 +181,11 @@ Item {
181 }
181 }
182 }
182 }
183
183
184− DirectionalDragArea {
184+ EdgeDragArea {
185 id: dragArea
185 id: dragArea
186
186
187 direction: Direction.Rightwards
187 direction: Direction.Rightwards
188
188
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−
196 enabled: root.available && root.state !== "visible"
189 enabled: root.available && root.state !== "visible"
197 width: root.dragAreaWidth
190 width: root.dragAreaWidth
198 height: root.height
191 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+
1unity8 (7.81.2) saucy; urgency=low
7unity8 (7.81.2) saucy; urgency=low
2
8
3 * Translation updates.
9 * Translation updates.