@@ -46,17 +46,17 @@ Item {
46 id: mainColumn
46 id: mainColumn
48 fill: parent
48 fill: parent
49− topMargin: units.gu(0.5)
49+// topMargin: units.gu(0.5)
50− bottomMargin: units.gu(1)
50+// bottomMargin: units.gu(1)
51 leftMargin: units.gu(0.5)
51 leftMargin: units.gu(0.5)
52 rightMargin: units.gu(0.5)
52 rightMargin: units.gu(0.5)
54− spacing: units.gu(0.5)
54+ //spacing: units.gu(0.5)
56 MouseArea {
56 MouseArea {
57 id: dashItem
57 id: dashItem
58 width: parent.width
58 width: parent.width
59− height: units.gu(6.5)
59+ height: units.gu(7)
60 onClicked: root.dashItemSelected(0)
60 onClicked: root.dashItemSelected(0)
@@ -90,22 +90,23 @@ Item {
90 id: launcherListView
90 id: launcherListView
91 objectName: "launcherListView"
91 objectName: "launcherListView"
92 anchors.fill: parent
92 anchors.fill: parent
93− anchors.topMargin: -itemSize
93+ anchors.topMargin: -itemHeight
94− anchors.bottomMargin: -itemSize
94+ anchors.bottomMargin: -itemHeight
95− topMargin: itemSize
95+ topMargin: itemHeight
96− bottomMargin: itemSize
96+ bottomMargin: itemHeight
97 height: parent.height - dashItem.height - parent.spacing*2
97 height: parent.height - dashItem.height - parent.spacing*2
98 model: root.model
98 model: root.model
99− cacheBuffer: itemSize * 3
99+ cacheBuffer: itemHeight * 3
100 snapMode: interactive ? ListView.SnapToItem : ListView.NoSnap
100 snapMode: interactive ? ListView.SnapToItem : ListView.NoSnap
101 highlightRangeMode: ListView.ApplyRange
101 highlightRangeMode: ListView.ApplyRange
102− preferredHighlightBegin: (height - itemSize) / 2
102+ preferredHighlightBegin: (height - itemHeight) / 2
103− preferredHighlightEnd: (height + itemSize) / 2
103+ preferredHighlightEnd: (height + itemHeight) / 2
104 layoutDirection: root.inverted ? Qt.RightToLeft : Qt.LeftToRight
104 layoutDirection: root.inverted ? Qt.RightToLeft : Qt.LeftToRight
106 // The height of the area where icons start getting folded
106 // The height of the area where icons start getting folded
107− property int foldingAreaHeight: itemSize * 0.75
107+ property int foldingAreaHeight: itemHeight * 0.75
108− property int itemSize: width
108+ property int itemWidth: width
109+ property int itemHeight: width * 7.5 / 8
109 property int clickFlickSpeed: units.gu(60)
110 property int clickFlickSpeed: units.gu(60)
110 property int draggedIndex: dndArea.draggedIndex
111 property int draggedIndex: dndArea.draggedIndex
@@ -116,8 +117,8 @@ Item {
116 delegate: LauncherListDelegate {
117 delegate: LauncherListDelegate {
117 id: launcherDelegate
118 id: launcherDelegate
118 objectName: "launcherDelegate" + index
119 objectName: "launcherDelegate" + index
119− itemHeight: launcherListView.itemSize
120+ itemHeight: launcherListView.itemHeight
120− itemWidth: launcherListView.itemSize
121+ itemWidth: launcherListView.itemWidth
121 width: itemWidth
122 width: itemWidth
122 height: itemHeight
123 height: itemHeight
123 iconName: model.icon
124 iconName: model.icon
@@ -178,9 +179,9 @@ Item {
180 onClicked: {
181 onClicked: {
181− var realItemSize = launcherListView.itemSize + launcherListView.spacing
182+ var realItemHeight = launcherListView.itemHeight + launcherListView.spacing
182 var realContentY = launcherListView.contentY + launcherListView.topMargin
183 var realContentY = launcherListView.contentY + launcherListView.topMargin
183− var index = Math.floor((mouseY + realContentY) / realItemSize);
184+ var index = Math.floor((mouseY + realContentY) / realItemHeight);
184 var clickedItem = launcherListView.itemAt(mouseX, mouseY + realContentY)
185 var clickedItem = launcherListView.itemAt(mouseX, mouseY + realContentY)
186 print("clicked on", index, clickedItem)
187 print("clicked on", index, clickedItem)
@@ -234,9 +235,9 @@ Item {
236 onPressAndHold: {
237 onPressAndHold: {
237− var realItemSize = launcherListView.itemSize + launcherListView.spacing
238+ var realItemHeight = launcherListView.itemHeight + launcherListView.spacing
238 var realContentY = launcherListView.contentY + launcherListView.topMargin
239 var realContentY = launcherListView.contentY + launcherListView.topMargin
239− draggedIndex = Math.floor((mouseY + realContentY) / realItemSize);
240+ draggedIndex = Math.floor((mouseY + realContentY) / realItemHeight);
241 launcherListView.interactive = false
242 launcherListView.interactive = false
@@ -245,7 +246,7 @@ Item {
245 quickListPopover = PopupUtils.open(popoverComponent, selectedItem,
246 quickListPopover = PopupUtils.open(popoverComponent, selectedItem,
246 {model: quickListModel, appId: quickListAppId})
247 {model: quickListModel, appId: quickListAppId})
248− var yOffset = draggedIndex > 0 ? (mouseY + realContentY) % (draggedIndex * realItemSize) : mouseY + realContentY
249+ var yOffset = draggedIndex > 0 ? (mouseY + realContentY) % (draggedIndex * realItemHeight) : mouseY + realContentY
250 fakeDragItem.iconName = launcherListView.model.get(draggedIndex).icon
251 fakeDragItem.iconName = launcherListView.model.get(draggedIndex).icon
251 fakeDragItem.x = 0
252 fakeDragItem.x = 0
@@ -263,7 +264,7 @@ Item {
264 if (!selectedItem.dragging) {
265 if (!selectedItem.dragging) {
265 var distance = Math.max(Math.abs(mouseX - startX), Math.abs(mouseY - startY))
266 var distance = Math.max(Math.abs(mouseX - startX), Math.abs(mouseY - startY))
266− if (distance > launcherListView.itemSize) {
267+ if (distance > launcherListView.itemHeight) {
267 print("starting drag")
268 print("starting drag")
268 selectedItem.dragging = true
269 selectedItem.dragging = true
269 PopupUtils.close(quickListPopover)
270 PopupUtils.close(quickListPopover)
@@ -277,18 +278,18 @@ Item {
277 //root.dragPosition = mouseY
278 //root.dragPosition = mouseY
279 var realContentY = launcherListView.contentY + launcherListView.topMargin
280 var realContentY = launcherListView.contentY + launcherListView.topMargin
280− var realItemSize = launcherListView.itemSize + launcherListView.spacing
281+ var realItemHeight = launcherListView.itemHeight + launcherListView.spacing
281 var itemCenterY = fakeDragItem.y + fakeDragItem.height / 2
282 var itemCenterY = fakeDragItem.y + fakeDragItem.height / 2
283 // Move it down by the the missing size to compensate index calculation with only expanded items
284 // Move it down by the the missing size to compensate index calculation with only expanded items
284 itemCenterY += selectedItem.height / 2
285 itemCenterY += selectedItem.height / 2
286−// print("mouseY", mouseY, launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemSize)
287+// print("mouseY", mouseY, launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemHeight)
287− if (mouseY > launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemSize) {
288+ if (mouseY > launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemHeight) {
288// print("entered bottom area")
289// print("entered bottom area")
289 progressiveScrollingTimer.downwards = false
290 progressiveScrollingTimer.downwards = false
290 progressiveScrollingTimer.start()
291 progressiveScrollingTimer.start()
291− } else if (mouseY < realItemSize) {
292+ } else if (mouseY < realItemHeight) {
292 progressiveScrollingTimer.downwards = true
293 progressiveScrollingTimer.downwards = true
293 progressiveScrollingTimer.start()
294 progressiveScrollingTimer.start()
294// print("entered top area")
295// print("entered top area")
@@ -297,7 +298,7 @@ Item {
297// print("not in any area")
298// print("not in any area")
300− var newIndex = (itemCenterY + realContentY) / realItemSize
301+ var newIndex = (itemCenterY + realContentY) / realItemHeight
302 if (newIndex > draggedIndex + 1) {
303 if (newIndex > draggedIndex + 1) {
303 newIndex = draggedIndex + 1
304 newIndex = draggedIndex + 1
@@ -330,6 +331,7 @@ Item {
331 var maxY = -mainColumn.spacing*2
332 var maxY = -mainColumn.spacing*2
332 if (launcherListView.contentY < maxY) {
333 if (launcherListView.contentY < maxY) {
334+ print("moving upwards", launcherListView.contentY, maxY)
333 launcherListView.contentY = Math.min(launcherListView.contentY + units.dp(2), maxY)
335 launcherListView.contentY = Math.min(launcherListView.contentY + units.dp(2), maxY)
@@ -357,7 +359,7 @@ Item {
357 bottom: parent.bottom
359 bottom: parent.bottom
358 bottomMargin: launcherListView.bottomMargin
360 bottomMargin: launcherListView.bottomMargin
360− height: launcherListView.itemSize / 2
362+ height: launcherListView.itemHeight / 2
361 enabled: launcherListView.contentHeight - launcherListView.height - launcherListView.contentY > -launcherListView.bottomMargin
363 enabled: launcherListView.contentHeight - launcherListView.height - launcherListView.contentY > -launcherListView.bottomMargin
362 onClicked: launcherListView.flick(0, -launcherListView.clickFlickSpeed)
364 onClicked: launcherListView.flick(0, -launcherListView.clickFlickSpeed)
@@ -367,8 +369,8 @@ Item {
367 LauncherDelegate {
369 LauncherDelegate {
368 id: fakeDragItem
370 id: fakeDragItem
369 visible: dndArea.draggedIndex >= 0
371 visible: dndArea.draggedIndex >= 0
370− itemWidth: launcherListView.itemSize
372+ itemWidth: launcherListView.itemWidth
371− itemHeight: launcherListView.itemSize
373+ itemHeight: launcherListView.itemHeight
372 height: itemHeight
374 height: itemHeight
373 width: itemWidth
375 width: itemWidth
374 rotation: root.rotation
376 rotation: root.rotation