@@ -85,13 +85,12 @@ Showable {
8585 }
8686 }
8787
88− // TODO showing Dash Overview from temp scope
8988 ScopesOverview {
9089 id: scopesOverview
9190 anchors.fill: parent
9291 scope: scopes ? scopes.getScope("scopesOverview") : null
9392 progress: overviewController.progress
94− scopeScale: 1 - overviewController.progress * 0.6
93+ scopeScale: scopeItem.scope ? 0.4 : (1 - overviewController.progress * 0.6)
9594 visible: scopeScale != 1
9695 currentIndex: dashContent.currentIndex
9796 onDone: {
@@ -101,7 +100,7 @@ Showable {
101100 hide();
102101 }
103102 onFavoriteSelected: {
104− dashContent.setCurrentScopeAtIndex(index, false, false);
103+ setCurrentScope(scopeId, false, false);
105104 hide();
106105 }
107106 onAllFavoriteSelected: {
@@ -128,10 +127,18 @@ Showable {
128127 overviewController.enableAnimation = true;
129128 overviewController.progress = 0;
130129 }
130+ onProgressChanged: {
131+ if (progress == 0) {
132+ currentTab = scopeItem.scope ? 1 : 0;
133+ }
134+ }
131135 }
132136
133137 DashContent {
134138 id: dashContent
139+
140+ property var scopeThatOpenedScope: null
141+
135142 parent: overviewController.progress == 0 ? dash : scopesOverview.dashItemEater
136143 objectName: "dashContent"
137144 width: dash.width
@@ -143,7 +150,9 @@ Showable {
143150 dash.setCurrentScope(scopeId, true, false);
144151 }
145152 onOpenScope: {
153+ scopeThatOpenedScope = currentScope;
146154 scopeItem.scope = scope;
155+ scopesOverview.currentTab = 1;
147156 x = -width;
148157 }
149158 onScopeLoaded: {
@@ -156,10 +165,15 @@ Showable {
156165 clip: scale != 1.0 || scopeItem.visible || overviewController.progress != 0
157166 Behavior on x {
158167 UbuntuNumberAnimation {
168+ duration: overviewController.progress != 0 ? 0 : UbuntuAnimation.FastDuration
159169 onRunningChanged: {
160170 if (!running && dashContent.x == 0) {
161− dashContent.closeScope(scopeItem.scope);
171+ dashContent.scopeThatOpenedScope.closeScope(scopeItem.scope);
162172 scopeItem.scope = null;
173+ if (overviewController.progress == 0) {
174+ // Set tab to Favorites only if we are not showing the overview
175+ scopesOverview.currentTab = 0;
176+ }
163177 }
164178 }
165179 }
@@ -174,15 +188,36 @@ Showable {
174188 anchors.fill: scopeItem
175189 visible: scopeItem.visible
176190 parent: scopeItem.parent
191+ scale: scopeItem.scale
192+ opacity: scopeItem.opacity
177193 }
178194
179195 GenericScopeView {
180196 id: scopeItem
181197
182− anchors.left: dashContent.right
198+ readonly property real targetOverviewScale: {
199+ if (scopesOverview.currentTab == 0) {
200+ return 0.4;
201+ } else {
202+ return scopesOverview.allCardSize.width / scopeItem.width;
203+ }
204+ }
205+ readonly property real overviewProgressScale: (1 - overviewController.progress * (1 - targetOverviewScale))
206+ readonly property var targetOverviewPosition: scope ? scopesOverview.allScopeCardPosition(scope.id) : null
207+ readonly property real overviewProgressX: scope && scopesOverview.currentTab == 1 && targetOverviewPosition ?
208+ overviewController.progress * (targetOverviewPosition.x - (width - scopesOverview.allCardSize.width) / 2)
209+ : 0
210+ readonly property real overviewProgressY: scope && scopesOverview.currentTab == 1 && targetOverviewPosition ?
211+ overviewController.progress * (targetOverviewPosition.y - (height - scopesOverview.allCardSize.height) / 2)
212+ : 0
213+
214+ x: overviewController.progress == 0 ? dashContent.x + width : overviewProgressX
215+ y: overviewController.progress == 0 ? dashContent.y : overviewProgressY
183216 width: parent.width
184217 height: parent.height
185− scale: dash.contentScale
218+ scale: dash.contentScale * overviewProgressScale
219+ enabled: opacity == 1
220+ opacity: 1 - overviewController.progress
186221 clip: scale != 1.0
187222 visible: scope != null
188223 hasBackAction: true