Merge lp:~fboucault/unity-2d/scrollbar_drag_control_y into lp:unity-2d/3.0

Proposed by Florian Boucault
Status: Merged
Approved by: Ugo Riboni
Approved revision: 617
Merged at revision: 638
Proposed branch: lp:~fboucault/unity-2d/scrollbar_drag_control_y
Merge into: lp:unity-2d/3.0
Diff against target: 25 lines (+10/-4)
1 file modified
places/Scrollbar.qml (+10/-4)
To merge this branch: bzr merge lp:~fboucault/unity-2d/scrollbar_drag_control_y
Reviewer Review Type Date Requested Status
Ugo Riboni (community) Approve
Review via email: mp+67990@code.launchpad.net

Commit message

[dash] Only move the scrollbar depending on the flickable's visible area when the user is not dragging the scrollbar.

To post a comment you must log in.
Revision history for this message
Ugo Riboni (uriboni) wrote :

Code looks good, even though i'm not really sure what's the purpose of this change.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'places/Scrollbar.qml'
2--- places/Scrollbar.qml 2011-06-23 17:08:53 +0000
3+++ places/Scrollbar.qml 2011-07-14 16:47:25 +0000
4@@ -72,11 +72,17 @@
5 anchors.left: parent.left
6 anchors.right: parent.right
7
8- y: {
9- var clampedYPosition = Math.max(0, Math.min(1-targetFlickable.visibleArea.heightRatio,
10- targetFlickable.visibleArea.yPosition))
11- return clampedYPosition * scrollbar.height
12+ Binding {
13+ target: slider
14+ property: "y"
15+ value: {
16+ var clampedYPosition = Math.max(0, Math.min(1-targetFlickable.visibleArea.heightRatio,
17+ targetFlickable.visibleArea.yPosition))
18+ return clampedYPosition * scrollbar.height
19+ }
20+ when: !dragMouseArea.drag.active
21 }
22+
23 height: Math.max(minimalHeight, targetFlickable.visibleArea.heightRatio * scrollbar.height)
24
25 Behavior on height {NumberAnimation {duration: 200; easing.type: Easing.InOutQuad}}

Subscribers

People subscribed via source and target branches