@@ -199,14 +199,13 @@ Item {
200 // The angle used for rotating
200 // The angle used for rotating
203− // First item is special
202+ // First/last items are special
204 if (index == 0 || index == listView.count-1) {
203 if (index == 0 || index == listView.count-1) {
205 if (priv.distanceFromEdge < 0) {
204 if (priv.distanceFromEdge < 0) {
206 // distanceFromTopEdge : angle = totalUnfoldedHeight/2 : maxAngle
205 // distanceFromTopEdge : angle = totalUnfoldedHeight/2 : maxAngle
207 return Math.max(-maxAngle, priv.distanceFromEdge * maxAngle / (listView.foldingAreaHeight)) * priv.orientationFlag
206 return Math.max(-maxAngle, priv.distanceFromEdge * maxAngle / (listView.foldingAreaHeight)) * priv.orientationFlag
209− return 0; // Don't fold first item as long as inside the view
208+ return 0; // Don't fold first/last item as long as inside the view
212 // Are we in the already completely outside the flickable? Fold for the last 5 degrees
211 // Are we in the already completely outside the flickable? Fold for the last 5 degrees
@@ -226,7 +225,7 @@ Item {
228 opacity: {
227 opacity: {
229− // First item is special
228+ // First/last items are special
230 if (index == 0 || index == listView.count-1) {
229 if (index == 0 || index == listView.count-1) {
231 if (priv.distanceFromEdge < 0) {
230 if (priv.distanceFromEdge < 0) {
232 // Fade from 1 to 0 in the distance of 3 * foldingAreaHeight (which is when the next item reaches the edge)
231 // Fade from 1 to 0 in the distance of 3 * foldingAreaHeight (which is when the next item reaches the edge)
@@ -235,7 +234,7 @@ Item {
235 return 1; // Don't make first/last item transparent as long as inside the view
234 return 1; // Don't make first/last item transparent as long as inside the view
238− // Are we in the already completely outside the flickable? Fade to from 0.75 to 0 in twice 2 items height
237+ // Are we already completely outside the flickable? Fade from 0.75 to 0 in 2 items height
239 if (priv.distanceFromEdge < 0) {
238 if (priv.distanceFromEdge < 0) {
240 // -distanceFromEdge : 1-opacity = totalUnfoldedHeight : 0.75
239 // -distanceFromEdge : 1-opacity = totalUnfoldedHeight : 0.75
241 return 0.75 - (-priv.distanceFromEdge * 0.75 / (priv.totalUnfoldedHeight*2))
240 return 0.75 - (-priv.distanceFromEdge * 0.75 / (priv.totalUnfoldedHeight*2))
@@ -250,16 +249,19 @@ Item {
252 brightness: {
251 brightness: {
252+ // First/last items are special
253 if (index == 0 || index == listView.count-1) {
253 if (index == 0 || index == listView.count-1) {
254 if (priv.distanceFromEdge < 0) {
254 if (priv.distanceFromEdge < 0) {
255 return -(-priv.distanceFromEdge / (listView.foldingAreaHeight * 3))
255 return -(-priv.distanceFromEdge / (listView.foldingAreaHeight * 3))
257 return 0;
257 return 0;
259+ // Are we already completely outside the flickable? Fade from 0.7 to 0 in 2 items height
259 if (priv.distanceFromEdge < 0) {
260 if (priv.distanceFromEdge < 0) {
260 return -0.3 - (-priv.distanceFromEdge * 0.1 / (priv.totalUnfoldedHeight*2))
261 return -0.3 - (-priv.distanceFromEdge * 0.1 / (priv.totalUnfoldedHeight*2))
264+ // We are overlapping with the folding area, fade out to 0.7
263 if (priv.overlapWithFoldingArea > 0) {
265 if (priv.overlapWithFoldingArea > 0) {
264 return - (priv.overlapWithFoldingArea * 0.3 / listView.foldingAreaHeight)
266 return - (priv.overlapWithFoldingArea * 0.3 / listView.foldingAreaHeight)