on xenial help sign in
added missing ; at imperative line endings
503fad1Michael Zanetti
qml/Stages/PhoneStage.qml+15−15
@@ -44,7 +44,7 @@ Item {
44 priv.requestNewScreenshot();
44 priv.requestNewScreenshot();
45 } else {
45 } else {
46 mainScreenshotImage.anchors.leftMargin = 0;
46 mainScreenshotImage.anchors.leftMargin = 0;
47− mainScreenshotImage.src = ApplicationManager.get(0).screenshot
47+ mainScreenshotImage.src = ApplicationManager.get(0).screenshot;
48 mainScreenshotImage.visible = true;
48 mainScreenshotImage.visible = true;
49 }
49 }
50 } else {
50 } else {
@@ -57,7 +57,7 @@ Item {
57
57
58 onFocusRequested: {
58 onFocusRequested: {
59 if (spreadView.visible) {
59 if (spreadView.visible) {
60− spreadView.snapTo(priv.indexOf(appId))
60+ spreadView.snapTo(priv.indexOf(appId));
61 } else {
61 } else {
62 priv.switchToApp(appId);
62 priv.switchToApp(appId);
63 }
63 }
@@ -68,12 +68,12 @@ Item {
68 if (priv.secondApplicationStarting || priv.applicationStarting) {
68 if (priv.secondApplicationStarting || priv.applicationStarting) {
69 appSplashTimer.start();
69 appSplashTimer.start();
70 } else {
70 } else {
71− var application = ApplicationManager.findApplication(ApplicationManager.focusedApplicationId)
71+ var application = ApplicationManager.findApplication(ApplicationManager.focusedApplicationId);
72− root.fullscreen = application.fullscreen
72+ root.fullscreen = application.fullscreen;
73− mainScreenshotImage.src = application.screenshot
73+ mainScreenshotImage.src = application.screenshot;
74 }
74 }
75 } else {
75 } else {
76− spreadView.selectedIndex = -1
76+ spreadView.selectedIndex = -1;
77 spreadView.stage = 0;
77 spreadView.stage = 0;
78 spreadView.contentX = -spreadView.shift;
78 spreadView.contentX = -spreadView.shift;
79 }
79 }
@@ -92,7 +92,7 @@ Item {
92 }
92 }
93
93
94 if (spreadView.visible) {
94 if (spreadView.visible) {
95− spreadView.snapTo(0)
95+ spreadView.snapTo(0);
96 }
96 }
97 }
97 }
98
98
@@ -101,7 +101,7 @@ Item {
101 mainScreenshotImage.src = ""
101 mainScreenshotImage.src = ""
102 mainScreenshotImage.visible = false;
102 mainScreenshotImage.visible = false;
103 } else {
103 } else {
104− mainScreenshotImage.src = ApplicationManager.get(0).screenshot
104+ mainScreenshotImage.src = ApplicationManager.get(0).screenshot;
105 }
105 }
106 }
106 }
107 }
107 }
@@ -256,13 +256,13 @@ Item {
256 spreadView.contentX = -spreadView.shift;
256 spreadView.contentX = -spreadView.shift;
257 }
257 }
258 if (dragging && attachedToView) {
258 if (dragging && attachedToView) {
259− spreadView.contentX = -touchX - spreadView.shift
259+ spreadView.contentX = -touchX - spreadView.shift;
260 }
260 }
261 if (attachedToView && spreadView.shiftedContentX >= spreadView.width * spreadView.positionMarker3) {
261 if (attachedToView && spreadView.shiftedContentX >= spreadView.width * spreadView.positionMarker3) {
262 attachedToView = false;
262 attachedToView = false;
263 spreadView.snap();
263 spreadView.snap();
264 }
264 }
265− gesturePoints.push(touchX)
265+ gesturePoints.push(touchX);
266 }
266 }
267
267
268 onStatusChanged: {
268 onStatusChanged: {
@@ -284,7 +284,7 @@ Item {
284 gesturePoints = [];
284 gesturePoints = [];
285
285
286 if (oneWayFlick && spreadView.shiftedContentX > units.gu(2) && spreadView.shiftedContentX < spreadView.positionMarker1 * spreadView.width) {
286 if (oneWayFlick && spreadView.shiftedContentX > units.gu(2) && spreadView.shiftedContentX < spreadView.positionMarker1 * spreadView.width) {
287− spreadView.snapTo(1)
287+ spreadView.snapTo(1);
288 } else if (!dragging && attachedToView) {
288 } else if (!dragging && attachedToView) {
289 spreadView.snap();
289 spreadView.snap();
290 }
290 }
@@ -432,10 +432,10 @@ Item {
432 // Each tile has a different progress value running from 0 to 1.
432 // Each tile has a different progress value running from 0 to 1.
433 // A progress value of 0 means the tile is at the right edge. 1 means the tile has reched the left edge.
433 // A progress value of 0 means the tile is at the right edge. 1 means the tile has reched the left edge.
434 progress: {
434 progress: {
435− var tileProgress = (spreadView.shiftedContentX - index * spreadView.tileDistance) / spreadView.width
435+ var tileProgress = (spreadView.shiftedContentX - index * spreadView.tileDistance) / spreadView.width;
436 // Tile 1 needs to move directly from the beginning...
436 // Tile 1 needs to move directly from the beginning...
437 if (index == 1 && spreadView.stage < 2) {
437 if (index == 1 && spreadView.stage < 2) {
438− tileProgress += spreadView.tileDistance / spreadView.width
438+ tileProgress += spreadView.tileDistance / spreadView.width;
439 }
439 }
440 return tileProgress;
440 return tileProgress;
441 }
441 }
@@ -446,9 +446,9 @@ Item {
446 if (progress < spreadView.positionMarker1) {
446 if (progress < spreadView.positionMarker1) {
447 return progress;
447 return progress;
448 } else if (progress < spreadView.positionMarker1 + snappingCurve.period){
448 } else if (progress < spreadView.positionMarker1 + snappingCurve.period){
449− return spreadView.positionMarker1 + snappingCurve.value * 3
449+ return spreadView.positionMarker1 + snappingCurve.value * 3;
450 } else {
450 } else {
451− return spreadView.positionMarker2
451+ return spreadView.positionMarker2;
452 }
452 }
453 }
453 }
454 return progress;
454 return progress;
qml/Stages/SpreadDelegate.qml+6−1
@@ -39,7 +39,12 @@ Item {
39 }
39 }
40 Image {
40 Image {
41 id: appImage
41 id: appImage
42+ anchors {
43+ left: parent.left;
44+ bottom: parent.bottom;
45+ top: parent.top;
42− anchors { left: parent.left; bottom: parent.bottom; top: parent.top; topMargin: priv.heightDifference * Math.max(0, 1 - root.topMarginProgress) }
46+ topMargin: priv.heightDifference * Math.max(0, 1 - root.topMarginProgress)
47+ }
43 source: model.screenshot
48 source: model.screenshot
44 antialiasing: true
49 antialiasing: true
45 scale: 1
50 scale: 1
qml/Stages/TransformedSpreadDelegate.qml+50−33
@@ -62,16 +62,16 @@ SpreadDelegate {
62 if (spreadView.stage == 1) {
62 if (spreadView.stage == 1) {
63 if (index == 0) {
63 if (index == 0) {
64 priv.stage2startTranslate = priv.easingAnimation(0, spreadView.positionMarker4, 0, -spreadView.width, spreadView.positionMarker4) + spreadView.width;
64 priv.stage2startTranslate = priv.easingAnimation(0, spreadView.positionMarker4, 0, -spreadView.width, spreadView.positionMarker4) + spreadView.width;
65− priv.stage2startAngle = priv.easingAnimation(0, spreadView.positionMarker4, root.startAngle, root.endAngle, spreadView.positionMarker4)
65+ priv.stage2startAngle = priv.easingAnimation(0, spreadView.positionMarker4, root.startAngle, root.endAngle, spreadView.positionMarker4);
66− priv.stage2startScale = priv.easingAnimation(0, spreadView.positionMarker4, root.startScale, root.endScale, spreadView.positionMarker4)
66+ priv.stage2startScale = priv.easingAnimation(0, spreadView.positionMarker4, root.startScale, root.endScale, spreadView.positionMarker4);
67− priv.stage2startTopMarginProgress = priv.easingAnimation(0, 1, 0, 1, spreadView.positionMarker4)
67+ priv.stage2startTopMarginProgress = priv.easingAnimation(0, 1, 0, 1, spreadView.positionMarker4);
68 } else if (index == 1) {
68 } else if (index == 1) {
69 // find where the main easing for Tile 1 would be when reaching stage 2
69 // find where the main easing for Tile 1 would be when reaching stage 2
70 var stage2Progress = spreadView.positionMarker4 - spreadView.tileDistance / spreadView.width;
70 var stage2Progress = spreadView.positionMarker4 - spreadView.tileDistance / spreadView.width;
71 priv.stage2startTranslate = priv.easingAnimation(0, stage2Progress, 0, -spreadView.width + root.endDistance, stage2Progress);
71 priv.stage2startTranslate = priv.easingAnimation(0, stage2Progress, 0, -spreadView.width + root.endDistance, stage2Progress);
72− priv.stage2startAngle = priv.easingAnimation(0, stage2Progress, root.startAngle, root.endAngle, stage2Progress)
72+ priv.stage2startAngle = priv.easingAnimation(0, stage2Progress, root.startAngle, root.endAngle, stage2Progress);
73 priv.stage2startScale = priv.easingAnimation(0, stage2Progress, root.startScale, root.endScale, stage2Progress);
73 priv.stage2startScale = priv.easingAnimation(0, stage2Progress, root.startScale, root.endScale, stage2Progress);
74− priv.stage2startTopMarginProgress = priv.easingAnimation(0, 1, 0, spreadView.positionMarker4, stage2Progress)
74+ priv.stage2startTopMarginProgress = priv.easingAnimation(0, 1, 0, spreadView.positionMarker4, stage2Progress);
75 }
75 }
76 }
76 }
77 }
77 }
@@ -127,7 +127,7 @@ SpreadDelegate {
127 property real xTranslate: {
127 property real xTranslate: {
128 if (otherSelected) {
128 if (otherSelected) {
129 if (spreadView.stage < 2 && index == 0) {
129 if (spreadView.stage < 2 && index == 0) {
130− return linearAnimation(selectedProgress, negativeProgress, selectedXTranslate, selectedXTranslate - spreadView.tileDistance, root.progress)
130+ return linearAnimation(selectedProgress, negativeProgress, selectedXTranslate, selectedXTranslate - spreadView.tileDistance, root.progress);
131 }
131 }
132
132
133 return selectedXTranslate;
133 return selectedXTranslate;
@@ -136,60 +136,70 @@ SpreadDelegate {
136 switch (index) {
136 switch (index) {
137 case 0:
137 case 0:
138 if (spreadView.stage == 0) {
138 if (spreadView.stage == 0) {
139− return Math.min(0, linearAnimation(0, spreadView.positionMarker2, 0, -spreadView.width * .25, root.animatedProgress))
139+ return Math.min(0, linearAnimation(0, spreadView.positionMarker2,
140+ 0, -spreadView.width * .25, root.animatedProgress));
140 } else if (spreadView.stage == 1){
141 } else if (spreadView.stage == 1){
141− return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, -spreadView.width * .25, priv.stage2startTranslate, root.progress)
142+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4,
143+ -spreadView.width * .25, priv.stage2startTranslate, root.progress);
142 } else if (!priv.isSelected){ // Stage 2
144 } else if (!priv.isSelected){ // Stage 2
143 // Apply the same animation as with the rest but add spreadView.width to align it with the others.
145 // Apply the same animation as with the rest but add spreadView.width to align it with the others.
144− return -easingCurve.value * spreadView.width + spreadView.width
146+ return -easingCurve.value * spreadView.width + spreadView.width;
145 } else if (priv.isSelected) {
147 } else if (priv.isSelected) {
146− return linearAnimation(selectedProgress, negativeProgress, selectedXTranslate, 0, root.progress)
148+ return linearAnimation(selectedProgress, negativeProgress, selectedXTranslate, 0, root.progress);
147 }
149 }
148
150
149 case 1:
151 case 1:
150 if (spreadView.stage == 0 && !priv.isSelected) {
152 if (spreadView.stage == 0 && !priv.isSelected) {
153+ return linearAnimation(0, spreadView.positionMarker2,
151− return linearAnimation(0, spreadView.positionMarker2, 0, -spreadView.width * spreadView.snapPosition, root.animatedProgress)
154+ 0, -spreadView.width * spreadView.snapPosition, root.animatedProgress);
152 } else if (spreadView.stage == 1 && !priv.isSelected) {
155 } else if (spreadView.stage == 1 && !priv.isSelected) {
153 return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4,
156 return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4,
154− -spreadView.width * spreadView.snapPosition, priv.stage2startTranslate, root.progress);
157+ -spreadView.width * spreadView.snapPosition, priv.stage2startTranslate,
158+ root.progress);
155 }
159 }
156 }
160 }
157
161
158 if (priv.isSelected) {
162 if (priv.isSelected) {
159 // Distance to left edge
163 // Distance to left edge
160− var targetTranslate = -spreadView.width - ((index - 1) * root.startDistance)
164+ var targetTranslate = -spreadView.width - ((index - 1) * root.startDistance);
161− return linearAnimation(selectedProgress, negativeProgress, selectedXTranslate, targetTranslate, root.progress)
165+ return linearAnimation(selectedProgress, negativeProgress,
166+ selectedXTranslate, targetTranslate, root.progress);
162 }
167 }
163
168
164 // Fix it at the right edge...
169 // Fix it at the right edge...
165− var rightEdgeOffset = -((index - 1) * root.startDistance)
170+ var rightEdgeOffset = -((index - 1) * root.startDistance);
166 // ...and use our easing to move them to the left. Stop a bit earlier for each tile
171 // ...and use our easing to move them to the left. Stop a bit earlier for each tile
167− return -easingCurve.value * spreadView.width + (index * animatedEndDistance) + rightEdgeOffset
172+ return -easingCurve.value * spreadView.width + (index * animatedEndDistance) + rightEdgeOffset;
168
173
169 }
174 }
170
175
171 property real angle: {
176 property real angle: {
172 if (priv.otherSelected) {
177 if (priv.otherSelected) {
173− return priv.selectedAngle
178+ return priv.selectedAngle;
174 }
179 }
175 if (priv.isSelected) {
180 if (priv.isSelected) {
176− return linearAnimation(selectedProgress, negativeProgress, selectedAngle, 0, root.progress)
181+ return linearAnimation(selectedProgress, negativeProgress, selectedAngle, 0, root.progress);
177 }
182 }
178 switch (index) {
183 switch (index) {
179 case 0:
184 case 0:
180 if (spreadView.stage == 0) {
185 if (spreadView.stage == 0) {
181− return Math.max(0, linearAnimation(0, spreadView.positionMarker2, 0, root.tile0SnapAngle, root.animatedProgress))
186+ return Math.max(0, linearAnimation(0, spreadView.positionMarker2,
187+ 0, root.tile0SnapAngle, root.animatedProgress));
182 } else if (spreadView.stage == 1) {
188 } else if (spreadView.stage == 1) {
183− return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, root.tile0SnapAngle, stage2startAngle, root.progress)
189+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4,
190+ root.tile0SnapAngle, stage2startAngle, root.progress);
184 }
191 }
185 case 1:
192 case 1:
186 if (spreadView.stage == 0) {
193 if (spreadView.stage == 0) {
187− return linearAnimation(0, spreadView.positionMarker2, root.startAngle, root.startAngle * (1-spreadView.snapPosition), root.animatedProgress)
194+ return linearAnimation(0, spreadView.positionMarker2, root.startAngle,
195+ root.startAngle * (1-spreadView.snapPosition), root.animatedProgress);
188 } else if (spreadView.stage == 1) {
196 } else if (spreadView.stage == 1) {
189− return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, root.startAngle * (1-spreadView.snapPosition), priv.stage2startAngle, root.progress)
197+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4,
198+ root.startAngle * (1-spreadView.snapPosition), priv.stage2startAngle,
199+ root.progress);
190 }
200 }
191 }
201 }
192− return root.startAngle - easingCurve.value * (root.startAngle - root.endAngle)
202+ return root.startAngle - easingCurve.value * (root.startAngle - root.endAngle);
193 }
203 }
194
204
195 property real scale: {
205 property real scale: {
@@ -197,7 +207,7 @@ SpreadDelegate {
197 return priv.selectedScale;
207 return priv.selectedScale;
198 }
208 }
199 if (priv.isSelected) {
209 if (priv.isSelected) {
200− return linearAnimation(selectedProgress, negativeProgress, selectedScale, 1, root.progress)
210+ return linearAnimation(selectedProgress, negativeProgress, selectedScale, 1, root.progress);
201 }
211 }
202
212
203 switch (index) {
213 switch (index) {
@@ -205,30 +215,35 @@ SpreadDelegate {
205 if (spreadView.stage == 0) {
215 if (spreadView.stage == 0) {
206 return 1;
216 return 1;
207 } else if(spreadView.stage == 1) {
217 } else if(spreadView.stage == 1) {
208− return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, 1, stage2startScale, root.progress)
218+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4,
219+ 1, stage2startScale, root.progress);
209 }
220 }
210 case 1:
221 case 1:
211 if (spreadView.stage == 0) {
222 if (spreadView.stage == 0) {
212 var targetScale = tile1StartScale - ((tile1StartScale - 1) * spreadView.snapPosition);
223 var targetScale = tile1StartScale - ((tile1StartScale - 1) * spreadView.snapPosition);
224+ return linearAnimation(0, spreadView.positionMarker2,
213− return linearAnimation(0, spreadView.positionMarker2, root.tile1StartScale, targetScale, root.animatedProgress)
225+ root.tile1StartScale, targetScale, root.animatedProgress);
214 } else if (spreadView.stage == 1) {
226 } else if (spreadView.stage == 1) {
215 var startScale = tile1StartScale - ((tile1StartScale - 1) * spreadView.snapPosition);
227 var startScale = tile1StartScale - ((tile1StartScale - 1) * spreadView.snapPosition);
216− return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, startScale, priv.stage2startScale, root.progress)
228+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4,
229+ startScale, priv.stage2startScale, root.progress);
217 }
230 }
218 }
231 }
219− return root.startScale - easingCurve.value * (root.startScale - root.endScale)
232+ return root.startScale - easingCurve.value * (root.startScale - root.endScale);
220 }
233 }
221
234
222 property real opacity: {
235 property real opacity: {
223 if (otherSelected) {
236 if (otherSelected) {
224− return linearAnimation (selectedProgress, Math.max(0, selectedProgress - .5), selectedOpacity, 0, root.progress)
237+ return linearAnimation (selectedProgress, Math.max(0, selectedProgress - .5),
238+ selectedOpacity, 0, root.progress);
225 }
239 }
226 if (index == 0) {
240 if (index == 0) {
227 switch (spreadView.stage) {
241 switch (spreadView.stage) {
228 case 0:
242 case 0:
229− return linearAnimation(0, spreadView.positionMarker2, 1, .3, root.animatedProgress)
243+ return linearAnimation(0, spreadView.positionMarker2, 1, .3, root.animatedProgress);
230 case 1:
244 case 1:
231− return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, .3, 1, root.animatedProgress)
245+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4,
246+ .3, 1, root.animatedProgress);
232 }
247 }
233 }
248 }
234
249
@@ -245,14 +260,16 @@ SpreadDelegate {
245 if (spreadView.stage == 0) {
260 if (spreadView.stage == 0) {
246 return 0;
261 return 0;
247 } else if (spreadView.stage == 1) {
262 } else if (spreadView.stage == 1) {
248− return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, 0, priv.stage2startTopMarginProgress, root.progress);
263+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4,
264+ 0, priv.stage2startTopMarginProgress, root.progress);
249 }
265 }
250 break;
266 break;
251 case 1:
267 case 1:
252 if (spreadView.stage == 0) {
268 if (spreadView.stage == 0) {
253 return 0;
269 return 0;
254 } else if (spreadView.stage == 1) {
270 } else if (spreadView.stage == 1) {
255− return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4, 0, priv.stage2startTopMarginProgress, root.progress);
271+ return linearAnimation(spreadView.positionMarker2, spreadView.positionMarker4,
272+ 0, priv.stage2startTopMarginProgress, root.progress);
256 }
273 }
257 }
274 }
258
275