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
=== modified file 'modules/Ubuntu/Components/Panel.qml'
--- modules/Ubuntu/Components/Panel.qml 2013-07-10 15:51:12 +0000
+++ modules/Ubuntu/Components/Panel.qml 2013-08-15 11:00:28 +0000
@@ -273,6 +273,15 @@
273 properties: "position"273 properties: "position"
274 duration: internal.transitionDuration274 duration: internal.transitionDuration
275 }275 }
276 },
277 Transition {
278 id: transitionToMoving
279 to: "moving"
280 UbuntuNumberAnimation {
281 target: bar
282 properties: "position"
283 duration: Toolkit.UbuntuAnimation.SnapDuration
284 }
276 }285 }
277 ]286 ]
278287
@@ -285,7 +294,6 @@
285 */294 */
286 property real transitionDuration: Toolkit.UbuntuAnimation.FastDuration295 property real transitionDuration: Toolkit.UbuntuAnimation.FastDuration
287296
288
289 property string previousState: ""297 property string previousState: ""
290 property int movingDelta298 property int movingDelta
291299
@@ -442,25 +450,34 @@
442 if (panel.state == "") panel.state = "hint";450 if (panel.state == "") panel.state = "hint";
443 }451 }
444452
453 /*!
454 The minimum amount of movement while pressed before switching to "moving" state.
455 This threshold is needed to avoid detecting unintentional small movements while
456 "clicking" as a drag.
457 */
458 property real dragThreshold: units.gu(1)
459
445 onPositionChanged: {460 onPositionChanged: {
446 if (panel.locked) return;461 if (panel.locked) return;
447 if (panel.state == "hint" && mousePosition < initialPosition) {462 if (panel.state == "hint" && mousePosition < initialPosition - dragThreshold) {
448 panel.state = "moving";463 panel.state = "moving";
449 pressedItem = null;464 pressedItem = null;
450 } else if (panel.state == "spread" && mousePosition > initialPosition) {465 } else if (panel.state == "spread" && mousePosition > initialPosition + dragThreshold) {
451 panel.state = "moving";466 panel.state = "moving";
452 pressedItem = null;467 pressedItem = null;
453 }468 }
454 }469 }
455470
456 onReleased: {471 onReleased: {
457 if (panel.locked) return;472 if (panel.state == "moving" || panel.state == "hint") {
458 finishMoving();473 finishMoving();
474 }
459 }475 }
460 // Mouse cursor moving out of the window while pressed on desktop476 // Mouse cursor moving out of the window while pressed on desktop
461 onCanceled: {477 onCanceled: {
462 if (panel.locked) return;478 if (panel.state == "moving" || panel.state == "hint") {
463 finishMoving();479 finishMoving();
480 }
464 }481 }
465482
466 // FIXME: Make all parameters below themable and resolution-independent.483 // FIXME: Make all parameters below themable and resolution-independent.

Subscribers

People subscribed via source and target branches

to status/vote changes: