@@ -23,7 +23,9 @@ import Ubuntu.Components 0.1
23SpreadDelegate {
23SpreadDelegate {
26+ // Set this to true when this tile is selected in the spread. The animation will change to bring the tile to front.
26 property bool selected: false
27 property bool selected: false
28+ // Set this to true when another tile in the spread is selected. The animation will change to fade this tile out.
27 property bool otherSelected: false
29 property bool otherSelected: false
29 // The progress animates the tiles. A value > 0 makes it appear from the right edge. At 1 it reaches the end position.
31 // The progress animates the tiles. A value > 0 makes it appear from the right edge. At 1 it reaches the end position.
@@ -129,7 +131,7 @@ SpreadDelegate {
129 // All tiles are kept in place and faded out to 0 opacity except
131 // All tiles are kept in place and faded out to 0 opacity except
130 // the selected tile, which is animated from the snapshotted position to be fullscreen.
132 // the selected tile, which is animated from the snapshotted position to be fullscreen.
132− property real xTranslate: {
134+ readonly property real xTranslate: {
133 if (otherSelected) {
135 if (otherSelected) {
134 if (spreadView.phase < 2 && index == 0) {
136 if (spreadView.phase < 2 && index == 0) {
135 return linearAnimation(selectedProgress, 0, selectedXTranslate,
137 return linearAnimation(selectedProgress, 0, selectedXTranslate,
@@ -175,12 +177,12 @@ SpreadDelegate {
175 // Fix it at the right edge...
177 // Fix it at the right edge...
176 var rightEdgeOffset = -((index - 1) * root.startDistance);
178 var rightEdgeOffset = -((index - 1) * root.startDistance);
177 // ...and use our easing to move them to the left. Stop a bit earlier for each tile
179 // ...and use our easing to move them to the left. Stop a bit earlier for each tile
178− var animatedEndDistance = linearAnimation(0, 2, root.endDistance, 0, root.progress)
180+ var animatedEndDistance = linearAnimation(0, 2, root.endDistance, 0, root.progress);
179 return -easingCurve.value * spreadView.width + (index * animatedEndDistance) + rightEdgeOffset;
181 return -easingCurve.value * spreadView.width + (index * animatedEndDistance) + rightEdgeOffset;
183− property real angle: {
185+ readonly property real angle: {
184 if (spreadView.focusChanging) {
186 if (spreadView.focusChanging) {
185 return 0;
187 return 0;
@@ -213,7 +215,7 @@ SpreadDelegate {
213 return root.startAngle - easingCurve.value * (root.startAngle - root.endAngle);
215 return root.startAngle - easingCurve.value * (root.startAngle - root.endAngle);
216− property real scale: {
218+ readonly property real scale: {
217 if (spreadView.focusChanging) {
219 if (spreadView.focusChanging) {
218 return 1;
220 return 1;
@@ -246,7 +248,7 @@ SpreadDelegate {
246 return root.startScale - easingCurve.value * (root.startScale - root.endScale);
248 return root.startScale - easingCurve.value * (root.startScale - root.endScale);
249− property real opacity: {
251+ readonly property real opacity: {
250 if (priv.otherSelected) {
252 if (priv.otherSelected) {
251 return linearAnimation (selectedProgress, Math.max(0, selectedProgress - .5),
253 return linearAnimation (selectedProgress, Math.max(0, selectedProgress - .5),
252 selectedOpacity, 0, root.progress);
254 selectedOpacity, 0, root.progress);
@@ -264,7 +266,7 @@ SpreadDelegate {
264 return 1;
266 return 1;
267− property real topMarginProgress: {
269+ readonly property real topMarginProgress: {
268 if (priv.isSelected) {
270 if (priv.isSelected) {
269 return linearAnimation(selectedProgress, 0, selectedTopMarginProgress, 0, root.progress);
271 return linearAnimation(selectedProgress, 0, selectedTopMarginProgress, 0, root.progress);