@@ -80,8 +80,9 @@ Showable {
8080 property alias enableAnimation: progressAnimation.enabled
8181 property real progress: 0
8282 property bool showingNonFavoriteScope: false
83− property bool growingDashFromAll: false
84− property var allScopePosition: undefined
83+ property bool growingDashFromPos: false
84+ property var allScopePosition
85+ property var allScopeSize
8586 Behavior on progress {
8687 id: progressAnimation
8788 UbuntuNumberAnimation { }
@@ -114,17 +115,19 @@ Showable {
114115 hide();
115116 }
116117 onAllSelected: {
117− scopeItem.scope = scopes.getScope(scopeId);
118− scopeItem.parent = scopesOverviewXYScaler;
119− scopesOverviewXYScaler.scale = scopesOverview.allCardSize.width / scopesOverviewXYScaler.width;
120− scopesOverviewXYScaler.x = pos.x -(scopesOverviewXYScaler.width - scopesOverviewXYScaler.width * scopesOverviewXYScaler.scale) / 2;
121− scopesOverviewXYScaler.y = pos.y -(scopesOverviewXYScaler.height - scopesOverviewXYScaler.height * scopesOverviewXYScaler.scale) / 2;
122− overviewController.showingNonFavoriteScope = true;
123− overviewController.allScopePosition = pos;
124− scopesOverview.overrideOpacity = 0;
125− scopesOverviewXYScaler.scale = 1;
126− scopesOverviewXYScaler.x = 0;
127− scopesOverviewXYScaler.y = 0;
118+ showTemporaryScope(scopeId, pos, scopesOverview.allCardSize);
119+ }
120+ onSearchSelected: {
121+ var scopeIndex = filteredScopes.findFirst(Scopes.RoleId, scopeId);
122+ if (scopeIndex >= 0) {
123+ // Is a favorite one
124+ setCurrentScope(scopeId, false, false);
125+ showDashFromPos(pos, size);
126+ hide();
127+ } else {
128+ // Is not a favorite one
129+ showTemporaryScope(scopeId, pos, size)
130+ }
128131 }
129132 function hide() {
130133 overviewController.enableAnimation = true;
@@ -133,17 +136,34 @@ Showable {
133136 function animateDashFromAll() {
134137 var currentScopePos = scopesOverview.allScopeCardPosition(dashContent.currentScopeId);
135138 if (currentScopePos) {
136− scopesOverviewXYScaler.scale = scopesOverview.allCardSize.width / scopesOverviewXYScaler.width;
137− scopesOverviewXYScaler.x = currentScopePos.x -(scopesOverviewXYScaler.width - scopesOverviewXYScaler.width * scopesOverviewXYScaler.scale) / 2;
138− scopesOverviewXYScaler.y = currentScopePos.y -(scopesOverviewXYScaler.height - scopesOverviewXYScaler.height * scopesOverviewXYScaler.scale) / 2;
139− overviewController.growingDashFromAll = true;
140− scopesOverviewXYScaler.scale = 1;
141− scopesOverviewXYScaler.x = 0;
142− scopesOverviewXYScaler.y = 0;
139+ showDashFromPos(currentScopePos, scopesOverview.allCardSize);
143140 } else {
144141 console.log("Warning: Could not find Dash OverView All card position for scope", dashContent.currentScopeId);
145142 }
146143 }
144+ function showDashFromPos(itemPos, itemSize) {
145+ scopesOverviewXYScaler.scale = itemSize.width / scopesOverviewXYScaler.width;
146+ scopesOverviewXYScaler.x = itemPos.x -(scopesOverviewXYScaler.width - scopesOverviewXYScaler.width * scopesOverviewXYScaler.scale) / 2;
147+ scopesOverviewXYScaler.y = itemPos.y -(scopesOverviewXYScaler.height - scopesOverviewXYScaler.height * scopesOverviewXYScaler.scale) / 2;
148+ overviewController.growingDashFromPos = true;
149+ scopesOverviewXYScaler.scale = 1;
150+ scopesOverviewXYScaler.x = 0;
151+ scopesOverviewXYScaler.y = 0;
152+ }
153+ function showTemporaryScope(scopeId, itemPos, itemSize) {
154+ scopeItem.scope = scopes.getScope(scopeId);
155+ scopeItem.parent = scopesOverviewXYScaler;
156+ scopesOverviewXYScaler.scale = itemSize.width / scopesOverviewXYScaler.width;
157+ scopesOverviewXYScaler.x = itemPos.x -(scopesOverviewXYScaler.width - scopesOverviewXYScaler.width * scopesOverviewXYScaler.scale) / 2;
158+ scopesOverviewXYScaler.y = itemPos.y -(scopesOverviewXYScaler.height - scopesOverviewXYScaler.height * scopesOverviewXYScaler.scale) / 2;
159+ overviewController.showingNonFavoriteScope = true;
160+ overviewController.allScopePosition = itemPos;
161+ overviewController.allScopeSize = itemSize;
162+ scopesOverview.overrideOpacity = 0;
163+ scopesOverviewXYScaler.scale = 1;
164+ scopesOverviewXYScaler.x = 0;
165+ scopesOverviewXYScaler.y = 0;
166+ }
147167 }
148168
149169 DashContent {
@@ -190,7 +210,7 @@ Showable {
190210 }
191211
192212 enabled: opacity == 1
193− opacity: overviewController.growingDashFromAll ? 1 : 1 - overviewController.progress
213+ opacity: overviewController.growingDashFromPos ? 1 : 1 - overviewController.progress
194214 }
195215
196216 DashBackground
@@ -214,7 +234,7 @@ Showable {
214234 isCurrent: visible
215235 onBackClicked: {
216236 if (overviewController.showingNonFavoriteScope) {
217− var v = scopesOverview.allCardSize.width / scopeItem.width;
237+ var v = overviewController.allScopeSize.width / scopeItem.width;
218238 scopesOverviewXYScaler.scale = v;
219239 scopesOverviewXYScaler.x = overviewController.allScopePosition.x -(scopeItem.width - scopeItem.width * v) / 2;
220240 scopesOverviewXYScaler.y = overviewController.allScopePosition.y -(scopeItem.height - scopeItem.height * v) / 2;
@@ -245,7 +265,7 @@ Showable {
245265 enabled: scale == 1
246266 opacity: scale
247267
248− property bool animationsEnabled: overviewController.showingNonFavoriteScope || overviewController.growingDashFromAll
268+ property bool animationsEnabled: overviewController.showingNonFavoriteScope || overviewController.growingDashFromPos
249269
250270 Behavior on x {
251271 enabled: scopesOverviewXYScaler.animationsEnabled
@@ -265,8 +285,8 @@ Showable {
265285 overviewController.showingNonFavoriteScope = false;
266286 scopeItem.scope = null;
267287 scopeItem.parent = dash;
268− } else if (overviewController.growingDashFromAll) {
269− overviewController.growingDashFromAll = false;
288+ } else if (overviewController.growingDashFromPos) {
289+ overviewController.growingDashFromPos = false;
270290 }
271291 }
272292 }