on xenial help sign in
various fixes:
5c06467Michael Zanetti
Launcher/LauncherDelegate.qml+1−1
@@ -77,7 +77,7 @@ Item {
77 width: parent.itemWidth
77 width: parent.itemWidth
78 height: parent.itemHeight
78 height: parent.itemHeight
79 property real itemOpacity: root.itemOpacity
79 property real itemOpacity: root.itemOpacity
80− property real brightness: root.brightness
80+ property real brightness: Math.max(-1, root.brightness)
81 property real angle: root.angle
81 property real angle: root.angle
82 rotation: root.inverted ? 180 : 0
82 rotation: root.inverted ? 180 : 0
83
83
Launcher/LauncherListDelegate.qml−4
@@ -22,10 +22,6 @@ LauncherDelegate {
22
22
23 // The angle used for rotating
23 // The angle used for rotating
24 angle: {
24 angle: {
25− if (index == 1 || index == priv.listView.count - 2) {
26− print("index", index, iconName, "overlaps with folding area", priv.overlapWithFoldingArea, priv.distanceFromEdge, priv.bottomDraggingDistanceOffset)
27− }
28−
29 // First/last items are special
25 // First/last items are special
30 if (index == 0 || index == priv.listView.count-1) {
26 if (index == 0 || index == priv.listView.count-1) {
31 if (priv.distanceFromEdge < 0) {
27 if (priv.distanceFromEdge < 0) {
Launcher/LauncherPanel.qml+24−29
@@ -89,11 +89,11 @@ Item {
89 objectName: "launcherListView"
89 objectName: "launcherListView"
90 anchors {
90 anchors {
91 fill: parent
91 fill: parent
92− topMargin: -itemHeight + units.gu(0.5)
92+ topMargin: -extensionSize + units.gu(0.5)
93− bottomMargin: -itemHeight + units.gu(1)
93+ bottomMargin: -extensionSize + units.gu(1)
94 }
94 }
95− topMargin: itemHeight
95+ topMargin: extensionSize
96− bottomMargin: itemHeight
96+ bottomMargin: extensionSize
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: itemHeight * 3
99 cacheBuffer: itemHeight * 3
@@ -104,6 +104,11 @@ Item {
104 layoutDirection: root.inverted ? Qt.RightToLeft : Qt.LeftToRight
104 layoutDirection: root.inverted ? Qt.RightToLeft : Qt.LeftToRight
105 spacing: units.gu(0.5)
105 spacing: units.gu(0.5)
106
106
107+ // The size of the area the ListView is extended to make sure items are not
108+ // destructed. Note that if the move() operation when dragging switches
109+ // the item with one that doesn't have a delegate yet everything breaks badly.
110+ property int extensionSize: itemHeight * 3
111+
107 // The height of the area where icons start getting folded
112 // The height of the area where icons start getting folded
108 property int foldingAreaHeight: itemHeight * 0.75
113 property int foldingAreaHeight: itemHeight * 0.75
109 property int itemWidth: width
114 property int itemWidth: width
@@ -115,8 +120,6 @@ Item {
115 NumberAnimation { properties: "x,y"; duration: 100 }
120 NumberAnimation { properties: "x,y"; duration: 100 }
116 }
121 }
117
122
118− onContentYChanged: print("contentY", contentY)
119−
120 delegate: LauncherListDelegate {
123 delegate: LauncherListDelegate {
121 id: launcherDelegate
124 id: launcherDelegate
122 objectName: "launcherDelegate" + index
125 objectName: "launcherDelegate" + index
@@ -177,8 +180,19 @@ Item {
177 Transition {
180 Transition {
178 from: "dragging"
181 from: "dragging"
179 to: "*"
182 to: "*"
180− NumberAnimation { properties: "itemOpacity"; duration: 150 }
183+ NumberAnimation { properties: "itemOpacity"; duration: 1500 }
184+ },
185+ Transition {
186+ from: ""
187+ to: "expanded"
188+ NumberAnimation { properties: "angle"; duration: 150 }
189+ },
190+ Transition {
191+ from: "expanded"
192+ to: ""
193+ NumberAnimation { properties: "angle"; duration: 150 }
181 }
194 }
195+
182 ]
196 ]
183 }
197 }
184
198
@@ -206,8 +220,6 @@ Item {
206 var index = Math.floor((mouseY + realContentY) / realItemHeight);
220 var index = Math.floor((mouseY + realContentY) / realItemHeight);
207 var clickedItem = launcherListView.itemAt(mouseX, mouseY + realContentY)
221 var clickedItem = launcherListView.itemAt(mouseX, mouseY + realContentY)
208
222
209− print("clicked on", index, clickedItem)
210−
211 // First/last item do the scrolling at more than 12 degrees
223 // First/last item do the scrolling at more than 12 degrees
212 if (index == 0 || index == launcherListView.count -1) {
224 if (index == 0 || index == launcherListView.count -1) {
213 if (clickedItem.angle > 12) {
225 if (clickedItem.angle > 12) {
@@ -232,27 +244,20 @@ Item {
232
244
233 onCanceled: {
245 onCanceled: {
234 selectedItem.highlighted = false
246 selectedItem.highlighted = false
247+ selectedItem = undefined;
235 }
248 }
236
249
237 onReleased: {
250 onReleased: {
238− print("released");
239 selectedItem.highlighted = false
251 selectedItem.highlighted = false
240 selectedItem.dragging = false;
252 selectedItem.dragging = false;
241 selectedItem = undefined;
253 selectedItem = undefined;
242
254
243− var droppedIndex = draggedIndex;
244 draggedIndex = -1;
255 draggedIndex = -1;
245 drag.target = undefined
256 drag.target = undefined
246
257
247 progressiveScrollingTimer.stop();
258 progressiveScrollingTimer.stop();
248−
249− // FIXME: remove the if condition once the ListView position bug is fixed.
250− // Right now setting currentIndex to 0 causes more issues than it helps.
251−// if (droppedIndex > 2) {
252−// launcherListView.currentIndex = -1;
253−// launcherListView.currentIndex = droppedIndex;
254−// }
255 launcherListView.interactive = true;
259 launcherListView.interactive = true;
260+
256 }
261 }
257
262
258 onPressAndHold: {
263 onPressAndHold: {
@@ -271,7 +276,7 @@ Item {
271
276
272 fakeDragItem.iconName = launcherListView.model.get(draggedIndex).icon
277 fakeDragItem.iconName = launcherListView.model.get(draggedIndex).icon
273 fakeDragItem.x = 0
278 fakeDragItem.x = 0
274− fakeDragItem.y = mouseY - yOffset
279+ fakeDragItem.y = mouseY - yOffset + launcherListView.anchors.topMargin + launcherListView.topMargin
275 drag.target = fakeDragItem
280 drag.target = fakeDragItem
276
281
277 startX = mouseX
282 startX = mouseX
@@ -284,7 +289,6 @@ Item {
284 if (!selectedItem.dragging) {
289 if (!selectedItem.dragging) {
285 var distance = Math.max(Math.abs(mouseX - startX), Math.abs(mouseY - startY))
290 var distance = Math.max(Math.abs(mouseX - startX), Math.abs(mouseY - startY))
286 if (distance > launcherListView.itemHeight) {
291 if (distance > launcherListView.itemHeight) {
287− print("starting drag")
288 selectedItem.dragging = true
292 selectedItem.dragging = true
289 PopupUtils.close(quickListPopover)
293 PopupUtils.close(quickListPopover)
290 }
294 }
@@ -293,9 +297,6 @@ Item {
293 return
297 return
294 }
298 }
295
299
296− //launcherPanel.dragPosition = inverted ? launcherListView.height - y : y
297− //root.dragPosition = mouseY
298−
299 var realContentY = launcherListView.contentY + launcherListView.topMargin
300 var realContentY = launcherListView.contentY + launcherListView.topMargin
300 var realItemHeight = launcherListView.itemHeight + launcherListView.spacing
301 var realItemHeight = launcherListView.itemHeight + launcherListView.spacing
301 var itemCenterY = fakeDragItem.y + fakeDragItem.height / 2
302 var itemCenterY = fakeDragItem.y + fakeDragItem.height / 2
@@ -303,18 +304,14 @@ Item {
303 // Move it down by the the missing size to compensate index calculation with only expanded items
304 // Move it down by the the missing size to compensate index calculation with only expanded items
304 itemCenterY += selectedItem.height / 2
305 itemCenterY += selectedItem.height / 2
305
306
306−// print("mouseY", mouseY, launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemHeight)
307 if (mouseY > launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemHeight) {
307 if (mouseY > launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemHeight) {
308−// print("entered bottom area")
309 progressiveScrollingTimer.downwards = false
308 progressiveScrollingTimer.downwards = false
310 progressiveScrollingTimer.start()
309 progressiveScrollingTimer.start()
311 } else if (mouseY < realItemHeight) {
310 } else if (mouseY < realItemHeight) {
312 progressiveScrollingTimer.downwards = true
311 progressiveScrollingTimer.downwards = true
313 progressiveScrollingTimer.start()
312 progressiveScrollingTimer.start()
314−// print("entered top area")
315 } else {
313 } else {
316 progressiveScrollingTimer.stop()
314 progressiveScrollingTimer.stop()
317−// print("not in any area")
318 }
315 }
319
316
320 var newIndex = (itemCenterY + realContentY) / realItemHeight
317 var newIndex = (itemCenterY + realContentY) / realItemHeight
@@ -328,7 +325,6 @@ Item {
328 }
325 }
329
326
330 if (newIndex >= 0 && newIndex < launcherListView.count) {
327 if (newIndex >= 0 && newIndex < launcherListView.count) {
331− print("moving", draggedIndex, "to", newIndex)
332 launcherListView.model.move(draggedIndex, newIndex)
328 launcherListView.model.move(draggedIndex, newIndex)
333 draggedIndex = newIndex
329 draggedIndex = newIndex
334 }
330 }
@@ -350,7 +346,6 @@ Item {
350 } else {
346 } else {
351 var maxY = launcherListView.contentHeight - launcherListView.height + launcherListView.topMargin + dndArea.selectedItem.effectiveHeight*2
347 var maxY = launcherListView.contentHeight - launcherListView.height + launcherListView.topMargin + dndArea.selectedItem.effectiveHeight*2
352 if (launcherListView.contentY < maxY) {
348 if (launcherListView.contentY < maxY) {
353− print("moving upwards", launcherListView.contentHeight, launcherListView.height, launcherListView.topMargin, dndArea.selectedItem.height, dndArea.selectedItem.effectiveHeight)
354 launcherListView.contentY = Math.min(launcherListView.contentY + units.dp(2), maxY)
349 launcherListView.contentY = Math.min(launcherListView.contentY + units.dp(2), maxY)
355 }
350 }
356 }
351 }