@@ -61,15 +61,14 @@ Item {
6161 width: parent.width
6262 interactive: false
6363
64− removeDisplaced: Transition { UbuntuNumberAnimation { properties: "y" } }
65− move: Transition { UbuntuNumberAnimation { properties: "y" } }
66− moveDisplaced: Transition { UbuntuNumberAnimation { properties: "y" } }
67−
6864 anchors.top: header.bottom
6965 delegate: Loader {
66+ id: loader
7067 asynchronous: true
7168 width: root.width
7269 height: listItemHeight
70+ clip: height != listItemHeight
71+ Behavior on height { enabled: visible; UbuntuNumberAnimation { } }
7372 sourceComponent: ScopesListCategoryItem {
7473 width: root.width
7574
@@ -79,6 +78,8 @@ Item {
7978 showStar: root.isFavoritesFeed || root.isOtherFeed
8079 isFavorite: root.isFavoritesFeed
8180
81+ hideChildren: dragItem.loaderToShrink == loader
82+
8283 onClicked: {
8384 if (!editMode) {
8485 root.requestActivate(result);
@@ -88,15 +89,18 @@ Item {
8889 onPressed: {
8990 if (editMode) {
9091 drag.target = dragItem;
91− drag.maximumX = 0;
92− drag.minimumX = 0;
92+ drag.maximumX = units.gu(1);
93+ drag.minimumX = units.gu(1);
9394 drag.minimumY = list.y - dragItem.height / 2;
9495 drag.maximumY = list.y + list.height - dragItem.height / 2
9596 dragItem.icon = icon;
9697 dragItem.text = text;
9798 dragItem.subtext = subtext;
98− dragItem.y = mapToItem(root, 0, 0).y + units.gu(1)
99+ dragItem.originalY = mapToItem(root, 0, 0).y;
100+ dragItem.y = dragItem.originalY;
101+ dragItem.x = units.gu(1);
99102 dragItem.visible = true;
103+ dragItem.loaderToShrink = loader;
100104 }
101105 }
102106 onPressAndHold: {
@@ -108,10 +112,12 @@ Item {
108112 if (dragItem.visible) {
109113 drag.target = undefined;
110114 dragItem.visible = false;
111− if (dragMarker.index != index && dragMarker.index != index + 1) {
112− var targetIndex = dragMarker.index > index ? dragMarker.index - 1 : dragMarker.index;
113− root.requestScopeMoveTo(model.scopeId, targetIndex);
115+ dragMarker.visible = false;
116+ if (dragMarker.index != index) {
117+ root.requestScopeMoveTo(model.scopeId, dragMarker.index);
114118 }
119+ dragItem.loaderToShrink.height = listItemHeight;
120+ dragItem.loaderToShrink = null;
115121 }
116122 }
117123 }
@@ -124,11 +130,11 @@ Item {
124130 opacity: 0.3
125131 height: units.dp(2)
126132 width: root.width
127− visible: dragItem.visible
133+ visible: false
128134 property int index: {
129− var i = Math.round((dragItem.y - list.y) / listItemHeight);
135+ var i = Math.round((dragItem.y - list.y + dragItem.height/2) / listItemHeight);
130136 if (i < 0) i = 0;
131− if (i >= model.count) i = model.count;
137+ if (i >= model.count - 1) i = model.count - 1;
132138 return i;
133139 }
134140 y: list.y + index * listItemHeight
@@ -136,11 +142,22 @@ Item {
136142
137143 ScopesListCategoryItem {
138144 id: dragItem
145+
146+ property real originalY
147+ property var loaderToShrink: null
148+
139149 objectName: "dragItem"
140150 visible: false
141151 showStar: false
142152 width: root.width
143153 height: listItemHeight
144154 opacity: 0.9
155+
156+ onYChanged: {
157+ if (!dragMarker.visible && Math.abs(y - originalY) > height / 2) {
158+ dragMarker.visible = true;
159+ loaderToShrink.height = 0;
160+ }
161+ }
145162 }
146163}