@@ -163,7 +163,7 @@ Item {
165 name: "expanded"
165 name: "expanded"
166− when: dndArea.draggedIndex >= 0 && (dndArea.preDragging || dndArea.selectedItem.dragging) && !dragging
166+ when: dndArea.draggedIndex >= 0 && (dndArea.preDragging || dndArea.dragging || dndArea.postDragging) && dndArea.draggedIndex != index
167 PropertyChanges {
167 PropertyChanges {
168 target: launcherDelegate
168 target: launcherDelegate
@@ -201,7 +201,11 @@ Item {
201 from: "dragging"
201 from: "dragging"
203 NumberAnimation { properties: "itemOpacity"; duration: UbuntuAnimation.BriskDuration }
203 NumberAnimation { properties: "itemOpacity"; duration: UbuntuAnimation.BriskDuration }
204+ SequentialAnimation {
204− NumberAnimation { properties: "height"; duration: UbuntuAnimation.BriskDuration; easing: UbuntuAnimation.StandardEasing }
205+ NumberAnimation { properties: "height"; duration:UbuntuAnimation.BriskDuration; easing: UbuntuAnimation.StandardEasing }
206+ PropertyAction { target: dndArea; property: "postDragging"; value: false }
207+ PropertyAction { target: dndArea; property: "draggedIndex"; value: -1 }
@@ -215,6 +219,8 @@ Item {
215 property int draggedIndex: -1
219 property int draggedIndex: -1
216 property var selectedItem
220 property var selectedItem
217 property bool preDragging: false
221 property bool preDragging: false
222+ property bool dragging: selectedItem !== undefined && selectedItem.dragging
223+ property bool postDragging: false
218 property int startX
224 property int startX
219 property int startY
225 property int startY
@@ -256,10 +262,11 @@ Item {
256 selectedItem.highlighted = false
262 selectedItem.highlighted = false
257 selectedItem = undefined;
263 selectedItem = undefined;
258 preDragging = false;
264 preDragging = false;
265+ postDragging = false;
261 onReleased: {
268 onReleased: {
262− draggedIndex = -1;
269+ postDragging = true;
263 selectedItem.highlighted = false
270 selectedItem.highlighted = false
264 selectedItem.dragging = false;
271 selectedItem.dragging = false;
265 selectedItem = undefined;
272 selectedItem = undefined;
@@ -292,7 +299,6 @@ Item {
293 onPositionChanged: {
300 onPositionChanged: {
294 if (draggedIndex >= 0) {
301 if (draggedIndex >= 0) {
296 if (!selectedItem.dragging) {
302 if (!selectedItem.dragging) {
297 var distance = Math.max(Math.abs(mouseX - startX), Math.abs(mouseY - startY))
303 var distance = Math.max(Math.abs(mouseX - startX), Math.abs(mouseY - startY))
298 if (!preDragging && distance > units.gu(1.5)) {
304 if (!preDragging && distance > units.gu(1.5)) {
@@ -393,7 +399,7 @@ Item {
393 LauncherDelegate {
399 LauncherDelegate {
394 id: fakeDragItem
400 id: fakeDragItem
395 objectName: "fakeDragItem"
401 objectName: "fakeDragItem"
396− visible: dndArea.draggedIndex >= 0
402+ visible: dndArea.draggedIndex >= 0 && !dndArea.postDragging
397 itemWidth: launcherListView.itemWidth
403 itemWidth: launcherListView.itemWidth
398 itemHeight: launcherListView.itemHeight
404 itemHeight: launcherListView.itemHeight
399 height: itemHeight
405 height: itemHeight