@@ -35,11 +35,8 @@ Item {
36 readonly property int contentWidth: flickableWidth - root.margins * 2
36 readonly property int contentWidth: flickableWidth - root.margins * 2
38− // The y offset we need to add because of scaled tiles in the stacks
39− readonly property int yOffset: -spreadHeight * stackScale / 2
41− readonly property int distance: (flickableContentWidth - (margins * 2) - (foldingAreaWidth * 2)) / totalItems
38+ readonly property int distance: (flickableContentWidth - (margins * 2) - (foldingAreaWidth * 2)) / (totalItems - 2)
42− readonly property int startPos: margins + foldingAreaWidth + itemIndex * distance
39+ readonly property int startPos: margins + foldingAreaWidth + (itemIndex - 1) * distance
43 readonly property int linearX: startPos - flickableProgress * (flickableContentWidth - flickableWidth)
40 readonly property int linearX: startPos - flickableProgress * (flickableContentWidth - flickableWidth)
45 readonly property int leftFoldingAreaX: margins + foldingAreaWidth
42 readonly property int leftFoldingAreaX: margins + foldingAreaWidth
@@ -51,17 +48,33 @@ Item {
51 readonly property real limitedLeftProgress: Math.min(2, leftFoldingAreaProgress)
48 readonly property real limitedLeftProgress: Math.min(2, leftFoldingAreaProgress)
52 readonly property real limitedRightProgress: Math.min(2, rightFoldingAreaProgress)
49 readonly property real limitedRightProgress: Math.min(2, rightFoldingAreaProgress)
52+// anchors { left: parent.left; top: parent.top; topMargin: - 100 }
53+// text: leftFoldingAreaProgress.toFixed(2)
55+// fontSize: "x-large"
55 readonly property int animatedX: {
59 readonly property int animatedX: {
56− if (leftFoldingAreaProgress > 4) {
60+ if (leftFoldingAreaProgress > 4) { // Stop it at the edge
57 return margins;
61 return margins;
59− if (leftFoldingAreaProgress > 2) {
63+ if (leftFoldingAreaProgress > 2) { // move it slowly through the stack
60 return linearAnimation(2, 4, margins + stackWidth, margins, leftFoldingAreaProgress)
64 return linearAnimation(2, 4, margins + stackWidth, margins, leftFoldingAreaProgress)
62− if (leftFoldingAreaProgress > 0) {
66+ if (leftFoldingAreaProgress > 1 && itemIndex == 0) {
67+ // The leftmost runs faster... make it stop before the stack and wait for others
68+ return margins + stackWidth;
71+ if (leftFoldingAreaProgress > 0) { // slow it down in a curve
72+ if (itemIndex == 0) { // except if it's the leftmost. that one goes straigt
73+ return linearAnimation(0, 1, leftFoldingAreaX, margins + stackWidth, leftFoldingAreaProgress)
63 return linearAnimation(0, 1, leftFoldingAreaX, margins + stackWidth, leftEasing.value)
75 return linearAnimation(0, 1, leftFoldingAreaX, margins + stackWidth, leftEasing.value)
77+ // same for the right side stack... mostly... don't need to treat the rightmost special...
65 if (rightFoldingAreaProgress > 4) {
78 if (rightFoldingAreaProgress > 4) {
66 return flickableWidth - margins
79 return flickableWidth - margins
@@ -76,23 +89,25 @@ Item {
76 return linearX;
89 return linearX;
79− readonly property int animatedY: sceneHeight - itemHeight - spreadBottomOffset +
92+ readonly property int animatedY: sceneHeight - itemHeight - spreadBottomOffset
80− (limitedLeftProgress > 0 ?
93+
82−// linearAnimation(0, 1, yOffset, 0, leftEasing.value)
83− : limitedRightProgress > 0 ?
85−// linearAnimation(0, 1, yOffset, 0, rightEasing.value)
90− readonly property int animatedAngle: limitedLeftProgress > 0 ?
94+ readonly property int animatedAngle: {
95+ if (limitedLeftProgress > 0) {
96+ // Leftmost is special...
98+ if (limitedLeftProgress < 1) {
99+ return unfoldedAngle;
101+ return linearAnimation(1, 2, unfoldedAngle, leftEndFoldedAngle, limitedLeftProgress)
91− linearAnimation(0, 2, unfoldedAngle, leftEndFoldedAngle, limitedLeftProgress)
104+ return linearAnimation(0, 2, unfoldedAngle, leftEndFoldedAngle, limitedLeftProgress)
92− : limitedRightProgress > 0 ?
105+ } else if (limitedRightProgress > 0) {
93− linearAnimation(0, 2, unfoldedAngle, rightEndFoldedAngle, limitedRightProgress)
106+ return linearAnimation(0, 2, unfoldedAngle, rightEndFoldedAngle, limitedRightProgress)
94− : unfoldedAngle
108+ return unfoldedAngle
97 readonly property real scale: limitedLeftProgress > 0 ?
112 readonly property real scale: limitedLeftProgress > 0 ?
98 linearAnimation(0, 1, 1, 1 + stackScale, leftEasing.value)
113 linearAnimation(0, 1, 1, 1 + stackScale, leftEasing.value)