on xenial help sign in
fix some side stage related issues
ee3e29dMichael Zanetti
qml/Stage/Spread/StagedRightEdgeMaths.qml+24−9
@@ -15,7 +15,7 @@ QtObject {
15 property int targetX: 0
15 property int targetX: 0
16 property int startY: 0
16 property int startY: 0
17 property int targetY: 0
17 property int targetY: 0
18− property real startAngle: 40
18+ property real startAngle: 30
19 property real targetAngle: 0
19 property real targetAngle: 0
20 property int targetHeight: 0
20 property int targetHeight: 0
21 property real startScale: 1.3
21 property real startScale: 1.3
@@ -24,6 +24,7 @@ QtObject {
24
24
25 property bool isMainStageApp: false
25 property bool isMainStageApp: false
26 property bool isSideStageApp: false
26 property bool isSideStageApp: false
27+ property bool sideStageOpen: false
27 property int nextInStack: 0
28 property int nextInStack: 0
28 property int shuffledZ: 0
29 property int shuffledZ: 0
29
30
@@ -97,46 +98,60 @@ QtObject {
97 }
98 }
98
99
99 readonly property real animatedAngle: {
100 readonly property real animatedAngle: {
101+ var nextStage = appRepeater.itemAt(nextInStack) ? appRepeater.itemAt(nextInStack).stage : ApplicationInfoInterface.MainStage;
102+
100 var startAngle = 0;
103 var startAngle = 0;
101 if (isMainStageApp) {
104 if (isMainStageApp) {
102 startAngle = 0;
105 startAngle = 0;
103 } else if (isSideStageApp) {
106 } else if (isSideStageApp) {
104 startAngle = 0;
107 startAngle = 0;
105 } else {
108 } else {
109+ if (stage == ApplicationInfoInterface.SideStage && itemIndex == nextInStack && !sideStageOpen) {
110+ startAngle = 0;
111+ } else {
106− startAngle = root.startAngle;
112+ startAngle = root.startAngle;
113+ }
107 }
114 }
108
115
109− var nextStage = appRepeater.itemAt(nextInStack) ? appRepeater.itemAt(nextInStack).stage : ApplicationInfoInterface.MainStage;
110
116
111 if (progress < breakPoint) {
117 if (progress < breakPoint) {
112− if (stage == nextStage) {
118+ if (itemIndex == nextInStack && sideStageOpen) {
113 return MathUtils.linearAnimation(0, 1, startAngle, targetAngle, progress);
119 return MathUtils.linearAnimation(0, 1, startAngle, targetAngle, progress);
114 } else {
120 } else {
115 return 0;
121 return 0;
116 }
122 }
117 }
123 }
118− if (itemIndex == nextInStack || (stage == nextStage && (isMainStageApp || isSideStageApp))) {
124+ if (itemIndex == nextInStack) {
119 return MathUtils.linearAnimation(0, 1, startAngle, targetAngle, progress);
125 return MathUtils.linearAnimation(0, 1, startAngle, targetAngle, progress);
120 }
126 }
121 return MathUtils.linearAnimation(breakPoint, 1, startAngle, targetAngle, progress);
127 return MathUtils.linearAnimation(breakPoint, 1, startAngle, targetAngle, progress);
122 }
128 }
123
129
124 readonly property real animatedScale: {
130 readonly property real animatedScale: {
131+ var pullingInSideStage = itemIndex == nextInStack && stage == ApplicationInfoInterface.SideStage && !sideStageOpen;
132+
125 var startScale = 1;
133 var startScale = 1;
126 if (isMainStageApp) {
134 if (isMainStageApp) {
127 startScale = 1;
135 startScale = 1;
128 } else if (isSideStageApp) {
136 } else if (isSideStageApp) {
129 startScale = 1;
137 startScale = 1;
130 } else {
138 } else {
139+ if (pullingInSideStage) {
140+ startScale = 1
141+ } else {
131− startScale = root.startScale;
142+ startScale = root.startScale;
143+ }
132 }
144 }
133
145
134− if (itemIndex == nextInStack) {
135− return MathUtils.linearAnimation(0, 1, startScale, targetScale, progress)
136− }
137 if (progress < breakPoint) {
146 if (progress < breakPoint) {
147+ if (itemIndex == nextInStack && sideStageOpen) {
148+ return MathUtils.linearAnimation(0, 1, startScale, targetScale, progress);
149+ }
138 return startScale;
150 return startScale;
139 }
151 }
152+ if (itemIndex == nextInStack) {
153+ return MathUtils.linearAnimation(0, 1, startScale, targetScale, progress)
154+ }
140
155
141 return MathUtils.linearAnimation(breakPoint, 1, startScale, targetScale, progress)
156 return MathUtils.linearAnimation(breakPoint, 1, startScale, targetScale, progress)
142 }
157 }
qml/Stage/Stage.qml+11−4
@@ -227,7 +227,7 @@ AbstractStage {
227
227
228 for (var i = 0; i < appRepeater.count && (!choseMainStage || !choseSideStage); ++i) {
228 for (var i = 0; i < appRepeater.count && (!choseMainStage || !choseSideStage); ++i) {
229 var appDelegate = appRepeater.itemAt(i);
229 var appDelegate = appRepeater.itemAt(i);
230− if (appDelegate.stage == ApplicationInfoInterface.SideStage
230+ if (sideStage.shown && appDelegate.stage == ApplicationInfoInterface.SideStage
231 && !choseSideStage) {
231 && !choseSideStage) {
232 priv.sideStageDelegate = appDelegate
232 priv.sideStageDelegate = appDelegate
233 priv.sideStageItemId = root.topLevelSurfaceList.idAt(i);
233 priv.sideStageItemId = root.topLevelSurfaceList.idAt(i);
@@ -411,11 +411,13 @@ AbstractStage {
411 ScriptAction {
411 ScriptAction {
412 script: {
412 script: {
413 var item = appRepeater.itemAt(Math.max(0, spreadItem.highlightedIndex));
413 var item = appRepeater.itemAt(Math.max(0, spreadItem.highlightedIndex));
414−
415− item.playFocusAnimation();
416 if (item.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
414 if (item.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
415+ print("showing sidestage")
417 sideStage.show();
416 sideStage.show();
418 }
417 }
418+
419+ item.playFocusAnimation();
420+ print("playing focus animation for item", item.appId, "stage:", item.stage, "shown", sideStage.shown)
419 }
421 }
420 }
422 }
421 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
423 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
@@ -956,6 +958,7 @@ AbstractStage {
956 isMainStageApp: priv.mainStageDelegate == appDelegate
958 isMainStageApp: priv.mainStageDelegate == appDelegate
957 isSideStageApp: priv.sideStageDelegate == appDelegate
959 isSideStageApp: priv.sideStageDelegate == appDelegate
958 sideStageWidth: sideStage.width
960 sideStageWidth: sideStage.width
961+ sideStageOpen: sideStage.shown
959 itemIndex: index
962 itemIndex: index
960 nextInStack: priv.nextInStack
963 nextInStack: priv.nextInStack
961 progress: 0
964 progress: 0
@@ -1734,12 +1737,16 @@ AbstractStage {
1734 (oneWayFlick && rightEdgeDragArea.distance > units.gu(2) || rightEdgeDragArea.distance > spreadItem.rightEdgeBreakPoint * spreadItem.width)) {
1737 (oneWayFlick && rightEdgeDragArea.distance > units.gu(2) || rightEdgeDragArea.distance > spreadItem.rightEdgeBreakPoint * spreadItem.width)) {
1735 var nextStage = appRepeater.itemAt(priv.nextInStack).stage
1738 var nextStage = appRepeater.itemAt(priv.nextInStack).stage
1736 for (var i = 0; i < appRepeater.count; i++) {
1739 for (var i = 0; i < appRepeater.count; i++) {
1737− if (appRepeater.itemAt(i).stage == nextStage) {
1740+ if (i != priv.nextInStack && appRepeater.itemAt(i).stage == nextStage) {
1738 appRepeater.itemAt(i).playHidingAnimation()
1741 appRepeater.itemAt(i).playHidingAnimation()
1739 break;
1742 break;
1740 }
1743 }
1741 }
1744 }
1742 appRepeater.itemAt(priv.nextInStack).playFocusAnimation()
1745 appRepeater.itemAt(priv.nextInStack).playFocusAnimation()
1746+ if (appRepeater.itemAt(priv.nextInStack).stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
1747+ sideStage.show();
1748+ }
1749+
1743 } else {
1750 } else {
1744 cancelled = true;
1751 cancelled = true;
1745 }
1752 }