@@ -24,23 +24,23 @@ LauncherDelegate {
25 // First/last items are special
25 // First/last items are special
26 if (index == 0 || index == priv.listView.count-1) {
26 if (index == 0 || index == priv.listView.count-1) {
27− if (priv.distanceFromEdge < 0) {
27+ if (priv.distanceFromEdge < priv.listView.foldingStopHeight) {
28 // proportion equation: distanceFromTopEdge : angle = totalUnfoldedHeight/2 : maxAngle
28 // proportion equation: distanceFromTopEdge : angle = totalUnfoldedHeight/2 : maxAngle
29− return Math.max(-maxAngle, priv.distanceFromEdge * maxAngle / (priv.listView.foldingAreaHeight)) * priv.orientationFlag
29+ return Math.max(-maxAngle, priv.distanceFromEdge * maxAngle / (priv.listView.foldingStartHeight)) * priv.orientationFlag
31 return 0; // Don't fold first/last item as long as inside the view
31 return 0; // Don't fold first/last item as long as inside the view
34− // Are we in the already completely outside the flickable? Fold for the last 5 degrees
34+ // We reached the folded area... fold the last 5 degrees
35− if (priv.distanceFromEdge < 0) {
35+ if (priv.overlapWithFoldedArea > 0) {
36− // proportion equation: -distanceFromTopEdge : angle = totalUnfoldedHeight : 5
36+ // proportion equation: overlap : x = height : 5
37− return Math.max(-maxAngle, (priv.distanceFromEdge * 5 / priv.listView.foldingAreaHeight) - (maxAngle-5)) * priv.orientationFlag
37+ return ((maxAngle - 5) + (priv.overlapWithFoldedArea * 5 / priv.foldingAreaHeight)) * -priv.orientationFlag
40 // We are overlapping with the folding area, fold the icon to maxAngle - 5 degrees
40 // We are overlapping with the folding area, fold the icon to maxAngle - 5 degrees
41 if (priv.overlapWithFoldingArea > 0) {
41 if (priv.overlapWithFoldingArea > 0) {
42 // proportion equation: overlap: totalHeight = angle : (maxAngle - 5)
42 // proportion equation: overlap: totalHeight = angle : (maxAngle - 5)
43− return -priv.overlapWithFoldingArea * (maxAngle -5) / priv.listView.foldingAreaHeight * priv.orientationFlag;
43+ return -priv.overlapWithFoldingArea * (maxAngle -5) / priv.foldingAreaHeight * priv.orientationFlag;
@@ -61,9 +61,9 @@ LauncherDelegate {
61 return (-priv.distanceFromEdge - (root.height - effectiveHeight)) * priv.orientationFlag;
61 return (-priv.distanceFromEdge - (root.height - effectiveHeight)) * priv.orientationFlag;
64− // We're touching the edge, move slower than the actual flicking speed.
64+ // We stopped folding, move slower than the actual flicking speed.
65− if (priv.distanceFromEdge < 0) {
65+ if (priv.overlapWithFoldedArea > 0) {
66− return (Math.abs(priv.distanceFromEdge) * priv.totalEffectiveHeight / priv.totalUnfoldedHeight) * priv.orientationFlag
66+ return (priv.overlapWithFoldedArea * priv.totalEffectiveHeight / priv.foldingAreaHeight) * priv.orientationFlag;
@@ -72,22 +72,23 @@ LauncherDelegate {
72 // First/last items are special
72 // First/last items are special
73 if (index == 0 || index == priv.listView.count-1) {
73 if (index == 0 || index == priv.listView.count-1) {
74 if (priv.distanceFromEdge < 0) {
74 if (priv.distanceFromEdge < 0) {
75− // Fade from 1 to 0 in the distance of 3 * foldingAreaHeight (which is when the next item reaches the edge)
75+ // Fade from 1 to 0 while the in 2*foldingAreaHeight
76+ // proportion equation: 0.5 : x = -2*foldingAreaHeight : distance
76− return 1.0 - (-priv.distanceFromEdge / (priv.listView.foldingAreaHeight * 3))
77+ return 1 + (priv.distanceFromEdge) / (priv.foldingAreaHeight*2)
78 return 1; // Don't make first/last item transparent as long as inside the view
79 return 1; // Don't make first/last item transparent as long as inside the view
81− // Are we already completely outside the flickable? Fade from 0.75 to 0 in 2 items height
82+ // Did we stop folding? Fade out to 0 in 2*foldingAreaHeight
82− if (priv.distanceFromEdge < 0) {
83+ if (priv.overlapWithFoldedArea > 0) {
83− // proportion equation: -distanceFromEdge : 1-opacity = totalUnfoldedHeight : 0.75
84+ // overlap : foldingAreaHeight = opacity : 0.75
84− return 0.75 - (-priv.distanceFromEdge * 0.75 / (priv.totalUnfoldedHeight*2))
85+ return 0.75 - (priv.overlapWithFoldedArea * 0.75 / (priv.foldingAreaHeight*2));
87− // We are overlapping with the folding area, fade out to 0.75
88+ // We are overlapping with the folding area, fade out to 0.75 transparency
88 if (priv.overlapWithFoldingArea > 0) {
89 if (priv.overlapWithFoldingArea > 0) {
89 // proportion equation: overlap : totalHeight = 1-opacity : 0.25
90 // proportion equation: overlap : totalHeight = 1-opacity : 0.25
90− return 1 - (priv.overlapWithFoldingArea * 0.25 / priv.listView.foldingAreaHeight)
91+ return 1 - (priv.overlapWithFoldingArea * 0.25 / priv.foldingAreaHeight)
@@ -95,19 +96,27 @@ LauncherDelegate {
95 brightness: {
96 brightness: {
96 // First/last items are special
97 // First/last items are special
97 if (index == 0 || index == priv.listView.count-1) {
98 if (index == 0 || index == priv.listView.count-1) {
100+ // Traversed one foldingAreaHeight. Stop at 0.5
101+ if (priv.distanceFromEdge < -priv.foldingAreaHeight) {
105+ // We started moving, fade to 0.5
98 if (priv.distanceFromEdge < 0) {
106 if (priv.distanceFromEdge < 0) {
99− return -(-priv.distanceFromEdge / (priv.listView.foldingAreaHeight * 3))
107+ return -0.5 * (-priv.distanceFromEdge / (priv.foldingAreaHeight))
101 return 0;
109 return 0;
103− // Are we already completely outside the flickable? Fade from 0.7 to 0 in 2 items height
111+
104− if (priv.distanceFromEdge < 0) {
112+ // We stopped folding? Stop brightness change at 0.5
105− return -0.3 - (-priv.distanceFromEdge * 0.1 / (priv.totalUnfoldedHeight*2))
113+ if (priv.overlapWithFoldedArea > 0) {
108− // We are overlapping with the folding area, fade out to 0.7
117+ // We are overlapping with the folding area, fade out to 0.5
109 if (priv.overlapWithFoldingArea > 0) {
118 if (priv.overlapWithFoldingArea > 0) {
110− return - (priv.overlapWithFoldingArea * 0.3 / priv.listView.foldingAreaHeight)
119+ return - (priv.overlapWithFoldingArea * 0.5 / priv.listView.foldingStartHeight);
112 return 0;
121 return 0;
@@ -127,7 +136,9 @@ LauncherDelegate {
127 property real distanceFromEdge: Math.abs(distanceFromBottomEdge) < Math.abs(distanceFromTopEdge) ? distanceFromBottomEdge : distanceFromTopEdge
136 property real distanceFromEdge: Math.abs(distanceFromBottomEdge) < Math.abs(distanceFromTopEdge) ? distanceFromBottomEdge : distanceFromTopEdge
128 property real orientationFlag: Math.abs(distanceFromBottomEdge) < Math.abs(distanceFromTopEdge) ? -1 : 1
137 property real orientationFlag: Math.abs(distanceFromBottomEdge) < Math.abs(distanceFromTopEdge) ? -1 : 1
130− property real overlapWithFoldingArea: listView.foldingAreaHeight - distanceFromEdge
139+ property real overlapWithFoldingArea: listView.foldingStartHeight - distanceFromEdge
140+ property real overlapWithFoldedArea: listView.foldingStopHeight - distanceFromEdge
141+ property real foldingAreaHeight: listView.foldingStartHeight - listView.foldingStopHeight