@@ -67,6 +67,7 @@ Item {
67 onClicked: root.clicked()
67 onClicked: root.clicked()
68 onCanceled: root.released()
68 onCanceled: root.released()
69 preventStealing: false
69 preventStealing: false
70+ enabled: root.angle < 5
71 onPressAndHold: {
72 onPressAndHold: {
72 root.state = "moving"
73 root.state = "moving"
@@ -153,18 +154,15 @@ Item {
153 QtObject {
154 QtObject {
156− // The height of the area where icons start getting folded
157− property int foldingAreaHeight: totalUnfoldedHeight * 0.75
159− property real totalUnfoldedHeight: launcherFlickable.itemSize + launcherColumn.spacing
157+ property real totalUnfoldedHeight: launcherListView.itemSize + launcherListView.spacing
160− property real totalEffectiveHeight: effectiveHeight + launcherColumn.spacing
158+ property real totalEffectiveHeight: effectiveHeight + launcherListView.spacing
161− property real distanceFromTopEdge: -(launcherFlickable.contentY - itemsBeforeThis*totalUnfoldedHeight)
159+ property real distanceFromTopEdge: -(launcherListView.contentY + launcherListView.topMargin - itemsBeforeThis*totalUnfoldedHeight)
162− property real distanceFromBottomEdge: launcherFlickable.height - (y+height) + launcherFlickable.contentY
160+ property real distanceFromBottomEdge: launcherListView.height - launcherListView.bottomMargin - (y+height) + launcherListView.contentY
164 property real distanceFromEdge: Math.abs(distanceFromBottomEdge) < Math.abs(distanceFromTopEdge) ? distanceFromBottomEdge : distanceFromTopEdge
162 property real distanceFromEdge: Math.abs(distanceFromBottomEdge) < Math.abs(distanceFromTopEdge) ? distanceFromBottomEdge : distanceFromTopEdge
165 property real orientationFlag: Math.abs(distanceFromBottomEdge) < Math.abs(distanceFromTopEdge) ? -1 : 1
163 property real orientationFlag: Math.abs(distanceFromBottomEdge) < Math.abs(distanceFromTopEdge) ? -1 : 1
167− property real overlapWithFoldingArea: foldingAreaHeight - distanceFromEdge
165+ property real overlapWithFoldingArea: launcherListView.foldingAreaHeight - distanceFromEdge
@@ -177,7 +175,7 @@ Item {
177 // This is the offset that keeps the items inside the panel
175 // This is the offset that keeps the items inside the panel
178 offset: {
176 offset: {
179 // First/last items are special
177 // First/last items are special
180− if (index == 0 || index == iconRepeater.count-1) {
178+ if (index == 0 || index == launcherListView.count-1) {
181 // Just keep them bound to the edges in case they're outside of the visible area
179 // Just keep them bound to the edges in case they're outside of the visible area
182 if (priv.distanceFromEdge < 0) {
180 if (priv.distanceFromEdge < 0) {
183 return (-priv.distanceFromEdge - (height - effectiveHeight)) * priv.orientationFlag;
181 return (-priv.distanceFromEdge - (height - effectiveHeight)) * priv.orientationFlag;
@@ -203,10 +201,10 @@ Item {
204 //return 0;
202 //return 0;
205 // First item is special
203 // First item is special
206− if (index == 0 || index == iconRepeater.count-1) {
204+ if (index == 0 || index == launcherListView.count-1) {
207 if (priv.distanceFromEdge < 0) {
205 if (priv.distanceFromEdge < 0) {
208 // distanceFromTopEdge : angle = totalUnfoldedHeight/2 : maxAngle
206 // distanceFromTopEdge : angle = totalUnfoldedHeight/2 : maxAngle
209− return Math.max(-maxAngle, priv.distanceFromEdge * maxAngle / (priv.foldingAreaHeight)) * priv.orientationFlag
207+ return Math.max(-maxAngle, priv.distanceFromEdge * maxAngle / (launcherListView.foldingAreaHeight)) * priv.orientationFlag
211 return 0; // Don't fold first item as long as inside the view
209 return 0; // Don't fold first item as long as inside the view
@@ -214,13 +212,13 @@ Item {
214 // Are we in the already completely outside the flickable? Fold for the last 5 degrees
212 // Are we in the already completely outside the flickable? Fold for the last 5 degrees
215 if (priv.distanceFromEdge < 0) {
213 if (priv.distanceFromEdge < 0) {
216 // -distanceFromTopEdge : angle = totalUnfoldedHeight : 5
214 // -distanceFromTopEdge : angle = totalUnfoldedHeight : 5
217− return Math.max(-maxAngle, (priv.distanceFromEdge * 5 / priv.foldingAreaHeight) - (maxAngle-5)) * priv.orientationFlag
215+ return Math.max(-maxAngle, (priv.distanceFromEdge * 5 / launcherListView.foldingAreaHeight) - (maxAngle-5)) * priv.orientationFlag
220 // We are overlapping with the folding area, fold the icon to maxAngle - 5 degrees
218 // We are overlapping with the folding area, fold the icon to maxAngle - 5 degrees
221 if (priv.overlapWithFoldingArea > 0) {
219 if (priv.overlapWithFoldingArea > 0) {
222 // overlap: totalHeight = angle : (maxAngle - 5)
220 // overlap: totalHeight = angle : (maxAngle - 5)
223− return -priv.overlapWithFoldingArea * (maxAngle -5) / priv.foldingAreaHeight * priv.orientationFlag;
221+ return -priv.overlapWithFoldingArea * (maxAngle -5) / launcherListView.foldingAreaHeight * priv.orientationFlag;
@@ -229,10 +227,10 @@ Item {
230 opacity: {
228 opacity: {
231 // First item is special
229 // First item is special
232− if (index == 0 || index == iconRepeater.count-1) {
230+ if (index == 0 || index == launcherListView.count-1) {
233 if (priv.distanceFromEdge < 0) {
231 if (priv.distanceFromEdge < 0) {
234 // Fade from 1 to 0 in the distance of 3 * foldingAreaHeight (which is when the next item reaches the edge)
232 // Fade from 1 to 0 in the distance of 3 * foldingAreaHeight (which is when the next item reaches the edge)
235− return 1.0 - (-priv.distanceFromEdge / (priv.foldingAreaHeight * 3))
233+ return 1.0 - (-priv.distanceFromEdge / (launcherListView.foldingAreaHeight * 3))
237 return 1; // Don't make first/last item transparent as long as inside the view
235 return 1; // Don't make first/last item transparent as long as inside the view
@@ -246,15 +244,15 @@ Item {
246 // We are overlapping with the folding area, fade out to 0.75
244 // We are overlapping with the folding area, fade out to 0.75
247 if (priv.overlapWithFoldingArea > 0) {
245 if (priv.overlapWithFoldingArea > 0) {
248 // overlap : totalHeight = 1-opacity : 0.25
246 // overlap : totalHeight = 1-opacity : 0.25
249− return 1 - (priv.overlapWithFoldingArea * 0.25 / priv.foldingAreaHeight)
247+ return 1 - (priv.overlapWithFoldingArea * 0.25 / launcherListView.foldingAreaHeight)
251 return 1;
249 return 1;
254 brightness: {
252 brightness: {
255− if (index == 0 || index == iconRepeater.count-1) {
253+ if (index == 0 || index == launcherListView.count-1) {
256 if (priv.distanceFromEdge < 0) {
254 if (priv.distanceFromEdge < 0) {
257− return -(-priv.distanceFromEdge / (priv.foldingAreaHeight * 3))
255+ return -(-priv.distanceFromEdge / (launcherListView.foldingAreaHeight * 3))
259 return 0;
257 return 0;
@@ -263,7 +261,7 @@ Item {
265 if (priv.overlapWithFoldingArea > 0) {
263 if (priv.overlapWithFoldingArea > 0) {
266− return - (priv.overlapWithFoldingArea * 0.3 / priv.foldingAreaHeight)
264+ return - (priv.overlapWithFoldingArea * 0.3 / launcherListView.foldingAreaHeight)
268 return 0;
266 return 0;