@@ -105,6 +105,9 @@ SpreadDelegate {
105105 if (index == 1) print("snapshotting values:", selectedProgress, selectedXTranslate, selectedAngle, selectedScale, selectedOpacity, selectedTopMarginProgress)
106106 }
107107
108+ // This calculates how much negative progress there can be if unwinding the spread completely
109+ // the progress for each tile starts at 0 when it crosses the right edge, so the later a tile comes in,
110+ // the bigger its negativeProgress can be.
108111 property real negativeProgress: {
109112 if (index == 1 && spreadView.phase < 2) {
110113 return 0;
@@ -125,10 +128,20 @@ SpreadDelegate {
125128
126129 property real animatedEndDistance: linearAnimation(0, 2, root.endDistance, 0, root.progress)
127130
131+ // The following blocks handle the animation of the tile in the spread.
132+ // At the beginning, each tile is attached at the right edge, outside the screen.
133+ // The progress for each tile starts at 0 and it reaches its end position at a progress of 1.
134+ // The first phases are handled special for the first 2 tiles. as we do the alt-tab and snapping in there
135+ // Once we reached phase 3, the animation is the same for all tiles.
136+ // When a tile is selected, the animation state is snapshotted, and the spreadView is unwound (progress animates
137+ // back to negativeProgress). All tiles are kept in place and faded out to 0 opacity except
138+ // the selected tile, which is animated from the snapshotted position to be fullscreen.
139+
128140 property real xTranslate: {
129141 if (otherSelected) {
130142 if (spreadView.phase < 2 && index == 0) {
131− return linearAnimation(selectedProgress, negativeProgress, selectedXTranslate, selectedXTranslate - spreadView.tileDistance, root.progress);
143+ return linearAnimation(selectedProgress, negativeProgress,
144+ selectedXTranslate, selectedXTranslate - spreadView.tileDistance, root.progress);
132145 }
133146
134147 return selectedXTranslate;