@@ -30,11 +30,10 @@ Item {
3030 property bool interactive
3131
3232 // State information propagated to the outside
33− property bool fullscreen: priv.focusedApplication ? priv.focusedApplication.fullscreen : false
34− property bool locked: spreadView.phase == 2
33+ readonly property bool locked: spreadView.phase == 2
3534
3635 function select(appId) {
37− spreadView.snapTo(priv.indexOf(appId))
36+ spreadView.snapTo(priv.indexOf(appId));
3837 }
3938
4039 onWidthChanged: {
@@ -54,21 +53,13 @@ Item {
5453 }
5554 }
5655
57− onFocusedApplicationIdChanged: {
58− if (ApplicationManager.focusedApplicationId.length > 0) {
59− var application = priv.focusedApplication;
60− root.fullscreen = application.fullscreen;
61− var appIndex = priv.indexOf(application.appId);
62− }
63− }
64−
6556 onApplicationAdded: {
6657 if (spreadView.phase == 2) {
6758 spreadView.snapTo(ApplicationManager.count - 1);
6859 } else {
6960 spreadView.phase = 0;
70− spreadView.contentX = -spreadView.shift
71− priv.switchToApp(appId)
61+ spreadView.contentX = -spreadView.shift;
62+ priv.switchToApp(appId);
7263 }
7364 }
7465
@@ -90,8 +81,7 @@ Item {
9081
9182 function switchToApp(appId) {
9283 if (priv.focusedAppId) {
93− root.fullscreen = ApplicationManager.findApplication(appId).fullscreen;
94− spreadView.focusChanging = true
84+ spreadView.focusChanging = true;
9585 ApplicationManager.focusApplication(appId);
9686 } else {
9787 ApplicationManager.focusApplication(appId);
@@ -182,9 +172,9 @@ Item {
182172 snapAnimation.targetContentX = -shift;
183173 snapAnimation.start();
184174 } else if (shiftedContentX < positionMarker2 * width) {
185− snapTo(1)
175+ snapTo(1);
186176 } else if (shiftedContentX < positionMarker3 * width) {
187− snapTo(1)
177+ snapTo(1);
188178 } else if (phase < 2){
189179 // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
190180 snapAnimation.targetContentX = width * positionMarker4 + 1 - shift;
@@ -197,7 +187,6 @@ Item {
197187 index = 0;
198188 }
199189 spreadView.selectedIndex = index;
200− root.fullscreen = ApplicationManager.get(index).fullscreen;
201190 // If we're not in full spread mode yet, always unwind to start pos
202191 // otherwise unwind up to progress 0 of the selected index
203192 if (spreadView.phase < 2) {
@@ -224,7 +213,7 @@ Item {
224213 if (spreadView.selectedIndex >= 0) {
225214 ApplicationManager.focusApplication(ApplicationManager.get(spreadView.selectedIndex).appId);
226215
227− spreadView.selectedIndex = -1
216+ spreadView.selectedIndex = -1;
228217 spreadView.phase = 0;
229218 spreadView.contentX = -spreadView.shift;
230219 }
@@ -244,7 +233,7 @@ Item {
244233 }
245234 onWidthChanged: {
246235 if (spreadView.closingIndex >= 0) {
247− spreadView.contentX = Math.min(spreadView.contentX, width - spreadView.width - spreadView.shift)
236+ spreadView.contentX = Math.min(spreadView.contentX, width - spreadView.width - spreadView.shift);
248237 }
249238 }
250239
@@ -280,7 +269,7 @@ Item {
280269 UbuntuNumberAnimation {
281270 onRunningChanged: {
282271 if (!running) {
283− spreadView.closingIndex = -1
272+ spreadView.closingIndex = -1;
284273 }
285274 }
286275 }
@@ -292,23 +281,27 @@ Item {
292281 duration: UbuntuAnimation.FastDuration
293282 onRunningChanged: {
294283 if (!running) {
295− spreadView.focusChanging = false
284+ spreadView.focusChanging = false;
296285 }
297286 }
298287 }
299288 }
300289
301290 // Each tile has a different progress value running from 0 to 1.
302− // A progress value of 0 means the tile is at the right edge. 1 means the tile has reched the left edge.
291+ // 0: means the tile is at the right edge.
292+ // 1: means the tile has finished the main animation towards the left edge.
293+ // >1: after the main animation has finished, tiles will continue to move very slowly to the left
303294 progress: {
304295 var tileProgress = (spreadView.shiftedContentX - behavioredIndex * spreadView.tileDistance) / spreadView.width;
305296 // Tile 1 needs to move directly from the beginning...
306297 if (behavioredIndex == 1 && spreadView.phase < 2) {
307298 tileProgress += spreadView.tileDistance / spreadView.width;
308299 }
309− // Limiting progress to ~0 and 1.7 to avoid binding calculations when tiles are either
310− // outside the screen on the right (progress < 0) or hidden by other tiles on the left
311− // (> 1.7). Using 0.0001 to differentiate when a tile should still be visible (==0)
300+ // Limiting progress to ~0 and 1.7 to avoid binding calculations when tiles are not
301+ // visible.
302+ // < 0 : The tile is outside the screen on the right
303+ // > 1.7: The tile is *very* close to the left edge and covered by other tiles now.
304+ // Using 0.0001 to differentiate when a tile should still be visible (==0)
312305 // or we can hide it (< 0)
313306 tileProgress = Math.max(-0.0001, Math.min(1.7, tileProgress));
314307 return tileProgress;
@@ -346,9 +339,9 @@ Item {
346339 }
347340
348341 onClosed: {
349− spreadView.draggedIndex = -1
350− spreadView.closingIndex = index
351− ApplicationManager.stopApplication(ApplicationManager.get(index).appId)
342+ spreadView.draggedIndex = -1;
343+ spreadView.closingIndex = index;
344+ ApplicationManager.stopApplication(ApplicationManager.get(index).appId);
352345 }
353346 }
354347 }
@@ -425,5 +418,4 @@ Item {
425418 }
426419 }
427420 }
428−
429421}