on xenial help sign in
made the height of the folding area configurable
commitd38563644f73bad42cc91c7ff55de62753cae905 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 20 Jun 2013, 12:01 (13 years ago) parentefc149e
1 file changed+10−6
Launcher/LauncherDelegate.qml+10−6
Launcher/LauncherDelegate.qml+10−6
@@ -100,6 +100,10 @@ Item {
100100
101101 QtObject {
102102 id: priv
103+
104+ // The height of the area where icons start getting folded
105+ property int foldingAreaHeight: totalUnfoldedHeight * 0.75
106+
103107 property real totalUnfoldedHeight: launcherFlickable.itemSize + launcherColumn.spacing
104108 property real totalEffectiveHeight: effectiveHeight + launcherColumn.spacing
105109 property real distanceFromTopEdge: -(launcherFlickable.contentY - itemsBeforeThis*totalUnfoldedHeight)
@@ -108,7 +112,7 @@ Item {
108112 property real distanceFromEdge: Math.abs(distanceFromBottomEdge) < Math.abs(distanceFromTopEdge) ? distanceFromBottomEdge : distanceFromTopEdge
109113 property real orientationFlag: Math.abs(distanceFromBottomEdge) < Math.abs(distanceFromTopEdge) ? -1 : 1
110114
111− property real overlapWithFoldingArea: totalUnfoldedHeight - distanceFromEdge
115+ property real overlapWithFoldingArea: foldingAreaHeight - distanceFromEdge
112116
113117 }
114118
@@ -147,7 +151,7 @@ Item {
147151 if (index == 0 || index == iconRepeater.count-1) {
148152 if (priv.distanceFromEdge < 0) {
149153 // distanceFromTopEdge : angle = totalUnfoldedHeight/2 : maxAngle
150− return Math.max(-maxAngle, priv.distanceFromEdge * maxAngle / (priv.totalUnfoldedHeight)) * priv.orientationFlag
154+ return Math.max(-maxAngle, priv.distanceFromEdge * maxAngle / (priv.foldingAreaHeight)) * priv.orientationFlag
151155 }
152156 return 0; // Don't fold first item as long as inside the view
153157 }
@@ -155,13 +159,13 @@ Item {
155159 // Are we in the already completely outside the flickable? Fold for the last 5 degrees
156160 if (priv.distanceFromEdge < 0) {
157161 // -distanceFromTopEdge : angle = totalUnfoldedHeight : 5
158− return Math.max(-maxAngle, (priv.distanceFromEdge * 5 / priv.totalUnfoldedHeight) - (maxAngle-5)) * priv.orientationFlag
162+ return Math.max(-maxAngle, (priv.distanceFromEdge * 5 / priv.foldingAreaHeight) - (maxAngle-5)) * priv.orientationFlag
159163 }
160164
161165 // We are overlapping with the folding area, fold the icon to maxAngle - 5 degrees
162166 if (priv.overlapWithFoldingArea > 0) {
163167 // overlap: totalHeight = angle : (maxAngle - 5)
164− return -priv.overlapWithFoldingArea * (maxAngle -5) / priv.totalUnfoldedHeight * priv.orientationFlag;
168+ return -priv.overlapWithFoldingArea * (maxAngle -5) / priv.foldingAreaHeight * priv.orientationFlag;
165169
166170 }
167171
@@ -187,7 +191,7 @@ Item {
187191 // We are overlapping with the folding area, fade out to 0.75
188192 if (priv.overlapWithFoldingArea > 0) {
189193 // overlap : totalHeight = 1-opacity : 0.25
190− return 1 - (priv.overlapWithFoldingArea * 0.25 / priv.totalUnfoldedHeight)
194+ return 1 - (priv.overlapWithFoldingArea * 0.25 / priv.foldingAreaHeight)
191195 }
192196 return 1;
193197 }
@@ -204,7 +208,7 @@ Item {
204208 }
205209
206210 if (priv.overlapWithFoldingArea > 0) {
207− return - (priv.overlapWithFoldingArea * 0.3 / priv.totalUnfoldedHeight)
211+ return - (priv.overlapWithFoldingArea * 0.3 / priv.foldingAreaHeight)
208212 }
209213 return 0;
210214 }