@@ -81,6 +81,7 @@ Item {
81 anchors.left: parent.left
81 anchors.left: parent.left
82 anchors.right: parent.right
82 anchors.right: parent.right
83 height: parent.height - dashItem.height - parent.spacing*2
83 height: parent.height - dashItem.height - parent.spacing*2
84 ListView {
85 ListView {
85 id: launcherListView
86 id: launcherListView
86 objectName: "launcherListView"
87 objectName: "launcherListView"
@@ -102,6 +103,7 @@ Item {
102 property int foldingAreaHeight: itemSize * 0.75
103 property int foldingAreaHeight: itemSize * 0.75
103 property int itemSize: width
104 property int itemSize: width
104 property int clickFlickSpeed: units.gu(60)
105 property int clickFlickSpeed: units.gu(60)
106+ property int draggedIndex: dndArea.draggedIndex
106 displaced: Transition {
108 displaced: Transition {
107 NumberAnimation { properties: "x,y"; duration: 100 }
109 NumberAnimation { properties: "x,y"; duration: 100 }
@@ -134,7 +136,7 @@ Item {
136 name: "expanded"
138 name: "expanded"
137− when: dndArea.draggedIndex >= 0 && !dragging
139+ //when: dndArea.draggedIndex >= 0 && !dragging
138 PropertyChanges {
140 PropertyChanges {
139 target: launcherDelegate
141 target: launcherDelegate
@@ -147,7 +149,7 @@ Item {
147 Transition {
149 Transition {
148 from: "*"
150 from: "*"
150− NumberAnimation { properties: "angle,offset"; duration: 200 }
152+// NumberAnimation { properties: "angle,offset"; duration: 200 }
151 NumberAnimation { properties: "height"; duration: 150 }
153 NumberAnimation { properties: "height"; duration: 150 }
@@ -222,11 +224,19 @@ Item {
222 selectedItem.dragging = false;
224 selectedItem.dragging = false;
223 selectedItem = undefined;
225 selectedItem = undefined;
227+ var droppedIndex = draggedIndex;
225 draggedIndex = -1;
228 draggedIndex = -1;
226 drag.target = undefined
229 drag.target = undefined
227− launcherListView.interactive = true;
229 progressiveScrollingTimer.stop();
231 progressiveScrollingTimer.stop();
233+ // FIXME: remove the if condition once the ListView position bug is fixed.
234+ // Right now setting currentIndex to 0 causes more issues than it helps.
235+ if (droppedIndex > 2) {
236+ launcherListView.currentIndex = -1;
237+ launcherListView.currentIndex = droppedIndex;
239+ launcherListView.interactive = true;
232 onPressAndHold: {
242 onPressAndHold: {
@@ -279,18 +289,18 @@ Item {
279 // Move it down by the the missing size to compensate index calculation with only expanded items
289 // Move it down by the the missing size to compensate index calculation with only expanded items
280 itemCenterY += selectedItem.height / 2
290 itemCenterY += selectedItem.height / 2
282− print("mouseY", mouseY, launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemSize)
292+// print("mouseY", mouseY, launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemSize)
283 if (mouseY > launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemSize) {
293 if (mouseY > launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemSize) {
284− print("entered bottom area")
294+// print("entered bottom area")
285 progressiveScrollingTimer.downwards = false
295 progressiveScrollingTimer.downwards = false
286 progressiveScrollingTimer.start()
296 progressiveScrollingTimer.start()
287 } else if (mouseY < realItemSize) {
297 } else if (mouseY < realItemSize) {
288 progressiveScrollingTimer.downwards = true
298 progressiveScrollingTimer.downwards = true
289 progressiveScrollingTimer.start()
299 progressiveScrollingTimer.start()
290− print("entered top area")
300+// print("entered top area")
292 progressiveScrollingTimer.stop()
302 progressiveScrollingTimer.stop()
293− print("not in any area")
303+// print("not in any area")
296 var newIndex = (itemCenterY + realContentY) / realItemSize
306 var newIndex = (itemCenterY + realContentY) / realItemSize