on xenial help sign in
fix some side stage related issues
commitee3e29d3436d5d89b60f3634adb40e3ec099a2d5 authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 20 Sep 2016, 13:44 (10 years ago) parente2630ec
2 files changed+35−13
qml/Stage/Spread/StagedRightEdgeMaths.qml+24−9 qml/Stage/Stage.qml+11−4
qml/Stage/Spread/StagedRightEdgeMaths.qml+24−9
@@ -15,7 +15,7 @@ QtObject {
1515 property int targetX: 0
1616 property int startY: 0
1717 property int targetY: 0
18− property real startAngle: 40
18+ property real startAngle: 30
1919 property real targetAngle: 0
2020 property int targetHeight: 0
2121 property real startScale: 1.3
@@ -24,6 +24,7 @@ QtObject {
2424
2525 property bool isMainStageApp: false
2626 property bool isSideStageApp: false
27+ property bool sideStageOpen: false
2728 property int nextInStack: 0
2829 property int shuffledZ: 0
2930
@@ -97,46 +98,60 @@ QtObject {
9798 }
9899
99100 readonly property real animatedAngle: {
101+ var nextStage = appRepeater.itemAt(nextInStack) ? appRepeater.itemAt(nextInStack).stage : ApplicationInfoInterface.MainStage;
102+
100103 var startAngle = 0;
101104 if (isMainStageApp) {
102105 startAngle = 0;
103106 } else if (isSideStageApp) {
104107 startAngle = 0;
105108 } else {
106− startAngle = root.startAngle;
109+ if (stage == ApplicationInfoInterface.SideStage && itemIndex == nextInStack && !sideStageOpen) {
110+ startAngle = 0;
111+ } else {
112+ startAngle = root.startAngle;
113+ }
107114 }
108115
109− var nextStage = appRepeater.itemAt(nextInStack) ? appRepeater.itemAt(nextInStack).stage : ApplicationInfoInterface.MainStage;
110116
111117 if (progress < breakPoint) {
112− if (stage == nextStage) {
118+ if (itemIndex == nextInStack && sideStageOpen) {
113119 return MathUtils.linearAnimation(0, 1, startAngle, targetAngle, progress);
114120 } else {
115121 return 0;
116122 }
117123 }
118− if (itemIndex == nextInStack || (stage == nextStage && (isMainStageApp || isSideStageApp))) {
124+ if (itemIndex == nextInStack) {
119125 return MathUtils.linearAnimation(0, 1, startAngle, targetAngle, progress);
120126 }
121127 return MathUtils.linearAnimation(breakPoint, 1, startAngle, targetAngle, progress);
122128 }
123129
124130 readonly property real animatedScale: {
131+ var pullingInSideStage = itemIndex == nextInStack && stage == ApplicationInfoInterface.SideStage && !sideStageOpen;
132+
125133 var startScale = 1;
126134 if (isMainStageApp) {
127135 startScale = 1;
128136 } else if (isSideStageApp) {
129137 startScale = 1;
130138 } else {
131− startScale = root.startScale;
139+ if (pullingInSideStage) {
140+ startScale = 1
141+ } else {
142+ startScale = root.startScale;
143+ }
132144 }
133145
134− if (itemIndex == nextInStack) {
135− return MathUtils.linearAnimation(0, 1, startScale, targetScale, progress)
136− }
137146 if (progress < breakPoint) {
147+ if (itemIndex == nextInStack && sideStageOpen) {
148+ return MathUtils.linearAnimation(0, 1, startScale, targetScale, progress);
149+ }
138150 return startScale;
139151 }
152+ if (itemIndex == nextInStack) {
153+ return MathUtils.linearAnimation(0, 1, startScale, targetScale, progress)
154+ }
140155
141156 return MathUtils.linearAnimation(breakPoint, 1, startScale, targetScale, progress)
142157 }
qml/Stage/Stage.qml+11−4
@@ -227,7 +227,7 @@ AbstractStage {
227227
228228 for (var i = 0; i < appRepeater.count && (!choseMainStage || !choseSideStage); ++i) {
229229 var appDelegate = appRepeater.itemAt(i);
230− if (appDelegate.stage == ApplicationInfoInterface.SideStage
230+ if (sideStage.shown && appDelegate.stage == ApplicationInfoInterface.SideStage
231231 && !choseSideStage) {
232232 priv.sideStageDelegate = appDelegate
233233 priv.sideStageItemId = root.topLevelSurfaceList.idAt(i);
@@ -411,11 +411,13 @@ AbstractStage {
411411 ScriptAction {
412412 script: {
413413 var item = appRepeater.itemAt(Math.max(0, spreadItem.highlightedIndex));
414−
415− item.playFocusAnimation();
416414 if (item.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
415+ print("showing sidestage")
417416 sideStage.show();
418417 }
418+
419+ item.playFocusAnimation();
420+ print("playing focus animation for item", item.appId, "stage:", item.stage, "shown", sideStage.shown)
419421 }
420422 }
421423 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
@@ -956,6 +958,7 @@ AbstractStage {
956958 isMainStageApp: priv.mainStageDelegate == appDelegate
957959 isSideStageApp: priv.sideStageDelegate == appDelegate
958960 sideStageWidth: sideStage.width
961+ sideStageOpen: sideStage.shown
959962 itemIndex: index
960963 nextInStack: priv.nextInStack
961964 progress: 0
@@ -1734,12 +1737,16 @@ AbstractStage {
17341737 (oneWayFlick && rightEdgeDragArea.distance > units.gu(2) || rightEdgeDragArea.distance > spreadItem.rightEdgeBreakPoint * spreadItem.width)) {
17351738 var nextStage = appRepeater.itemAt(priv.nextInStack).stage
17361739 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) {
17381741 appRepeater.itemAt(i).playHidingAnimation()
17391742 break;
17401743 }
17411744 }
17421745 appRepeater.itemAt(priv.nextInStack).playFocusAnimation()
1746+ if (appRepeater.itemAt(priv.nextInStack).stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
1747+ sideStage.show();
1748+ }
1749+
17431750 } else {
17441751 cancelled = true;
17451752 }