on xenial help sign in
tune comments
commit4831387ab2190a8310cc0ccd878a2e63b2fda7d2 authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 25 Jun 2013, 14:48 (13 years ago) parentebdabdd
1 file changed+7−5
Launcher/LauncherDelegate.qml+7−5
Launcher/LauncherDelegate.qml+7−5
@@ -199,14 +199,13 @@ Item {
199199
200200 // The angle used for rotating
201201 angle: {
202− //return 0;
203− // First item is special
202+ // First/last items are special
204203 if (index == 0 || index == listView.count-1) {
205204 if (priv.distanceFromEdge < 0) {
206205 // distanceFromTopEdge : angle = totalUnfoldedHeight/2 : maxAngle
207206 return Math.max(-maxAngle, priv.distanceFromEdge * maxAngle / (listView.foldingAreaHeight)) * priv.orientationFlag
208207 }
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
210209 }
211210
212211 // Are we in the already completely outside the flickable? Fold for the last 5 degrees
@@ -226,7 +225,7 @@ Item {
226225 }
227226
228227 opacity: {
229− // First item is special
228+ // First/last items are special
230229 if (index == 0 || index == listView.count-1) {
231230 if (priv.distanceFromEdge < 0) {
232231 // 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 {
235234 return 1; // Don't make first/last item transparent as long as inside the view
236235 }
237236
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
239238 if (priv.distanceFromEdge < 0) {
240239 // -distanceFromEdge : 1-opacity = totalUnfoldedHeight : 0.75
241240 return 0.75 - (-priv.distanceFromEdge * 0.75 / (priv.totalUnfoldedHeight*2))
@@ -250,16 +249,19 @@ Item {
250249 }
251250
252251 brightness: {
252+ // First/last items are special
253253 if (index == 0 || index == listView.count-1) {
254254 if (priv.distanceFromEdge < 0) {
255255 return -(-priv.distanceFromEdge / (listView.foldingAreaHeight * 3))
256256 }
257257 return 0;
258258 }
259+ // Are we already completely outside the flickable? Fade from 0.7 to 0 in 2 items height
259260 if (priv.distanceFromEdge < 0) {
260261 return -0.3 - (-priv.distanceFromEdge * 0.1 / (priv.totalUnfoldedHeight*2))
261262 }
262263
264+ // We are overlapping with the folding area, fade out to 0.7
263265 if (priv.overlapWithFoldingArea > 0) {
264266 return - (priv.overlapWithFoldingArea * 0.3 / listView.foldingAreaHeight)
265267 }