@@ -46,8 +46,6 @@ Item {
46 id: mainColumn
46 id: mainColumn
48 fill: parent
48 fill: parent
49−// topMargin: units.gu(0.5)
50−// bottomMargin: units.gu(1)
51 leftMargin: units.gu(0.5)
49 leftMargin: units.gu(0.5)
52 rightMargin: units.gu(0.5)
50 rightMargin: units.gu(0.5)
@@ -89,9 +87,11 @@ Item {
89 ListView {
87 ListView {
90 id: launcherListView
88 id: launcherListView
91 objectName: "launcherListView"
89 objectName: "launcherListView"
92− anchors.fill: parent
91+ fill: parent
93− anchors.topMargin: -itemHeight
92+ topMargin: -itemHeight + units.gu(0.5)
94− anchors.bottomMargin: -itemHeight
93+ bottomMargin: -itemHeight + units.gu(1)
95 topMargin: itemHeight
95 topMargin: itemHeight
96 bottomMargin: itemHeight
96 bottomMargin: itemHeight
97 height: parent.height - dashItem.height - parent.spacing*2
97 height: parent.height - dashItem.height - parent.spacing*2
@@ -102,6 +102,7 @@ Item {
102 preferredHighlightBegin: (height - itemHeight) / 2
102 preferredHighlightBegin: (height - itemHeight) / 2
103 preferredHighlightEnd: (height + itemHeight) / 2
103 preferredHighlightEnd: (height + itemHeight) / 2
104 layoutDirection: root.inverted ? Qt.RightToLeft : Qt.LeftToRight
104 layoutDirection: root.inverted ? Qt.RightToLeft : Qt.LeftToRight
105+ spacing: units.gu(0.5)
106 // The height of the area where icons start getting folded
107 // The height of the area where icons start getting folded
107 property int foldingAreaHeight: itemHeight * 0.75
108 property int foldingAreaHeight: itemHeight * 0.75
@@ -114,6 +115,8 @@ Item {
114 NumberAnimation { properties: "x,y"; duration: 100 }
115 NumberAnimation { properties: "x,y"; duration: 100 }
118+ onContentYChanged: print("contentY", contentY)
117 delegate: LauncherListDelegate {
120 delegate: LauncherListDelegate {
118 id: launcherDelegate
121 id: launcherDelegate
119 objectName: "launcherDelegate" + index
122 objectName: "launcherDelegate" + index
@@ -128,7 +131,21 @@ Item {
128 maxAngle: 60
131 maxAngle: 60
129 property bool dragging: false
132 property bool dragging: false
135+ anchors.centerIn: parent
136+ width: parent.width + mainColumn.anchors.leftMargin + mainColumn.anchors.rightMargin
137+ visible: parent.dragging
131 states: [
140 states: [
142+ name: "pre-dragging"
143+ when: dndArea.selectedItem === launcherDelegate && fakeDragItem.visible && !dragging
145+ target: launcherDelegate
133 name: "dragging"
150 name: "dragging"
134 when: dragging
151 when: dragging
@@ -137,6 +154,7 @@ Item {
137 angle: root.inverted ? -80 : 80
154 angle: root.inverted ? -80 : 80
138 offset: effectiveHeight / 2
155 offset: effectiveHeight / 2
139 height: effectiveHeight
156 height: effectiveHeight
@@ -154,8 +172,12 @@ Item {
154 Transition {
172 Transition {
155 from: "*"
173 from: "*"
157−// NumberAnimation { properties: "angle,offset"; duration: 200 }
158− NumberAnimation { properties: "height"; duration: 150 }
175+ NumberAnimation { properties: "height,itemOpacity"; duration: 150 }
180+ NumberAnimation { properties: "itemOpacity"; duration: 150 }
@@ -215,7 +237,6 @@ Item {
215 onReleased: {
237 onReleased: {
216 print("released");
238 print("released");
217 selectedItem.highlighted = false
239 selectedItem.highlighted = false
218− selectedItem.opacity = 1
219 selectedItem.dragging = false;
240 selectedItem.dragging = false;
220 selectedItem = undefined;
241 selectedItem = undefined;
@@ -227,10 +248,10 @@ Item {
228 // FIXME: remove the if condition once the ListView position bug is fixed.
249 // FIXME: remove the if condition once the ListView position bug is fixed.
229 // Right now setting currentIndex to 0 causes more issues than it helps.
250 // Right now setting currentIndex to 0 causes more issues than it helps.
230− if (droppedIndex > 2) {
251+// if (droppedIndex > 2) {
231− launcherListView.currentIndex = -1;
252+// launcherListView.currentIndex = -1;
232− launcherListView.currentIndex = droppedIndex;
253+// launcherListView.currentIndex = droppedIndex;
234 launcherListView.interactive = true;
255 launcherListView.interactive = true;
@@ -253,8 +274,6 @@ Item {
253 fakeDragItem.y = mouseY - yOffset
274 fakeDragItem.y = mouseY - yOffset
254 drag.target = fakeDragItem
275 drag.target = fakeDragItem
256− selectedItem.opacity = 0
258 startX = mouseX
277 startX = mouseX
259 startY = mouseY
278 startY = mouseY
@@ -324,14 +343,14 @@ Item {
324 property bool downwards: true
343 property bool downwards: true
325 onTriggered: {
344 onTriggered: {
326 if (downwards) {
345 if (downwards) {
327− var minY = launcherListView.contentHeight - launcherListView.height + mainColumn.spacing*2
346+ var minY = -launcherListView.topMargin
328 if (launcherListView.contentY > minY) {
347 if (launcherListView.contentY > minY) {
329 launcherListView.contentY = Math.max(launcherListView.contentY - units.dp(2), minY)
348 launcherListView.contentY = Math.max(launcherListView.contentY - units.dp(2), minY)
332− var maxY = -mainColumn.spacing*2
351+ var maxY = launcherListView.contentHeight - launcherListView.height + launcherListView.topMargin + dndArea.selectedItem.effectiveHeight*2
333 if (launcherListView.contentY < maxY) {
352 if (launcherListView.contentY < maxY) {
334− print("moving upwards", launcherListView.contentY, maxY)
353+ print("moving upwards", launcherListView.contentHeight, launcherListView.height, launcherListView.topMargin, dndArea.selectedItem.height, dndArea.selectedItem.effectiveHeight)
335 launcherListView.contentY = Math.min(launcherListView.contentY + units.dp(2), maxY)
354 launcherListView.contentY = Math.min(launcherListView.contentY + units.dp(2), maxY)
@@ -374,6 +393,7 @@ Item {
374 height: itemHeight
393 height: itemHeight
375 width: itemWidth
394 width: itemWidth
376 rotation: root.rotation
395 rotation: root.rotation