on xenial help sign in
merge with launcher-snap-after-drag
e7454a5Michael Zanetti
qml/Launcher/LauncherPanel.qml+17−5
@@ -48,7 +48,6 @@ Rectangle {
48 objectName: "buttonShowDashHome"
48 objectName: "buttonShowDashHome"
49 width: parent.width
49 width: parent.width
50 height: units.gu(7)
50 height: units.gu(7)
51− z: 1
52
51
53 UbuntuShape {
52 UbuntuShape {
54 anchors {
53 anchors {
@@ -139,6 +138,20 @@ Rectangle {
139 property bool draggingTransitionRunning: false
138 property bool draggingTransitionRunning: false
140 property int scheduledMoveTo: -1
139 property int scheduledMoveTo: -1
141
140
141+ UbuntuNumberAnimation {
142+ id: snapToBottomAnimation
143+ target: launcherListView
144+ property: "contentY"
145+ to: launcherListView.originY
146+ }
147+
148+ UbuntuNumberAnimation {
149+ id: snapToTopAnimation
150+ target: launcherListView
151+ property: "contentY"
152+ to: launcherListView.contentHeight - launcherListView.height + launcherListView.originY
153+ }
154+
142 displaced: Transition {
155 displaced: Transition {
143 NumberAnimation { properties: "x,y"; duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
156 NumberAnimation { properties: "x,y"; duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
144 }
157 }
@@ -344,10 +357,9 @@ Rectangle {
344 progressiveScrollingTimer.stop();
357 progressiveScrollingTimer.stop();
345 launcherListView.interactive = true;
358 launcherListView.interactive = true;
346 if (droppedIndex >= launcherListView.count - 2 && postDragging) {
359 if (droppedIndex >= launcherListView.count - 2 && postDragging) {
347− launcherListView.flick(0, -launcherListView.clickFlickSpeed);
360+ snapToBottomAnimation.start();
348− }
349− if (droppedIndex == 0 && postDragging) {
361+ } else if (droppedIndex < 2 && postDragging) {
350− launcherListView.flick(0, launcherListView.clickFlickSpeed);
362+ snapToTopAnimation.start();
351 }
363 }
352 }
364 }
353
365