Merge lp:~tpeeters/ubuntu-ui-toolkit/panel-dragThreshold into lp:ubuntu-ui-toolkit

Proposed by Tim Peeters
Status: Merged
Approved by: Zsombor Egri
Approved revision: 680
Merged at revision: 697
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/panel-dragThreshold
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 68 lines (+24/-7)
1 file modified
modules/Ubuntu/Components/Panel.qml (+24/-7)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/panel-dragThreshold
Reviewer Review Type Date Requested Status
Zsombor Egri Approve
PS Jenkins bot continuous-integration Approve
Tim Peeters Approve
Review via email: mp+178582@code.launchpad.net

Commit message

Add a drag threshold to Panel (and Toolbar) so that unintentional movements while clicking are not detected as a drag to open/close the panel.

Description of the change

Add a drag threshold to Panel (and Toolbar) so that unintentional movements while clicking are not detected as a drag to open/close the panel.

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
Tim Peeters (tpeeters) wrote :

tested on device with gallery-app and phone-app. Everything seems fine except that in gallery-app, when choosing "select" from the toolbar in the Events view, a blank bar appears above the toolbar, as if the contents is cropped (at incorrect height) when toolbar is locked. However, selecting "Select" from the Photos view this issue does not appear. In other views, and in phone-app, no issues were found.

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

The bug I mentioned above does exist, but is not related to the changes in this branch. It can also be reproduced in trunk, see https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1209133

review: Approve
677. By Tim Peeters

merge trunk

678. By Tim Peeters

faster movement when switching to moving state

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

On tablet, in Gallery App, when the toolbar hint is revealed by tapping on the bottom of the screen, the hint size toolbar stays on the screen no matter if you release your finger or tap somewhere else on the app screen. It can be hidden only by bringing the toolbar in completely and then dismissing it.

679. By Tim Peeters

hide/show toolbar after releasing when in hint mode

680. By Tim Peeters

merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

The code looks good. Nice one :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/Panel.qml'
2--- modules/Ubuntu/Components/Panel.qml 2013-07-10 15:51:12 +0000
3+++ modules/Ubuntu/Components/Panel.qml 2013-08-15 11:00:28 +0000
4@@ -273,6 +273,15 @@
5 properties: "position"
6 duration: internal.transitionDuration
7 }
8+ },
9+ Transition {
10+ id: transitionToMoving
11+ to: "moving"
12+ UbuntuNumberAnimation {
13+ target: bar
14+ properties: "position"
15+ duration: Toolkit.UbuntuAnimation.SnapDuration
16+ }
17 }
18 ]
19
20@@ -285,7 +294,6 @@
21 */
22 property real transitionDuration: Toolkit.UbuntuAnimation.FastDuration
23
24-
25 property string previousState: ""
26 property int movingDelta
27
28@@ -442,25 +450,34 @@
29 if (panel.state == "") panel.state = "hint";
30 }
31
32+ /*!
33+ The minimum amount of movement while pressed before switching to "moving" state.
34+ This threshold is needed to avoid detecting unintentional small movements while
35+ "clicking" as a drag.
36+ */
37+ property real dragThreshold: units.gu(1)
38+
39 onPositionChanged: {
40 if (panel.locked) return;
41- if (panel.state == "hint" && mousePosition < initialPosition) {
42+ if (panel.state == "hint" && mousePosition < initialPosition - dragThreshold) {
43 panel.state = "moving";
44 pressedItem = null;
45- } else if (panel.state == "spread" && mousePosition > initialPosition) {
46+ } else if (panel.state == "spread" && mousePosition > initialPosition + dragThreshold) {
47 panel.state = "moving";
48 pressedItem = null;
49 }
50 }
51
52 onReleased: {
53- if (panel.locked) return;
54- finishMoving();
55+ if (panel.state == "moving" || panel.state == "hint") {
56+ finishMoving();
57+ }
58 }
59 // Mouse cursor moving out of the window while pressed on desktop
60 onCanceled: {
61- if (panel.locked) return;
62- finishMoving();
63+ if (panel.state == "moving" || panel.state == "hint") {
64+ finishMoving();
65+ }
66 }
67
68 // FIXME: Make all parameters below themable and resolution-independent.

Subscribers

People subscribed via source and target branches

to status/vote changes: