on xenial help sign in
improve snapping after dragging
7666f34Michael Zanetti
qml/Launcher/LauncherPanel.qml+17−4
@@ -49,7 +49,6 @@ Rectangle {
49 width: parent.width
49 width: parent.width
50 height: units.gu(7)
50 height: units.gu(7)
51 color: UbuntuColors.orange
51 color: UbuntuColors.orange
52− z: 1
53
52
54 Image {
53 Image {
55 objectName: "dashItem"
54 objectName: "dashItem"
@@ -131,6 +130,20 @@ Rectangle {
131 property bool draggingTransitionRunning: false
130 property bool draggingTransitionRunning: false
132 property int scheduledMoveTo: -1
131 property int scheduledMoveTo: -1
133
132
133+ UbuntuNumberAnimation {
134+ id: snapToBottomAnimation
135+ target: launcherListView
136+ property: "contentY"
137+ to: launcherListView.originY
138+ }
139+
140+ UbuntuNumberAnimation {
141+ id: snapToTopAnimation
142+ target: launcherListView
143+ property: "contentY"
144+ to: launcherListView.contentHeight - launcherListView.height + launcherListView.originY
145+ }
146+
134 displaced: Transition {
147 displaced: Transition {
135 NumberAnimation { properties: "x,y"; duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
148 NumberAnimation { properties: "x,y"; duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
136 }
149 }
@@ -336,10 +349,10 @@ Rectangle {
336 progressiveScrollingTimer.stop();
349 progressiveScrollingTimer.stop();
337 launcherListView.interactive = true;
350 launcherListView.interactive = true;
338 if (droppedIndex >= launcherListView.count - 2 && postDragging) {
351 if (droppedIndex >= launcherListView.count - 2 && postDragging) {
339− launcherListView.flick(0, -launcherListView.clickFlickSpeed);
352+ snapToBottomAnimation.start();
340 }
353 }
341− if (droppedIndex == 0 && postDragging) {
354+ if (droppedIndex < 2 && postDragging) {
342− launcherListView.flick(0, launcherListView.clickFlickSpeed);
355+ snapToTopAnimation.start();
343 }
356 }
344 }
357 }
345
358