@@ -26,7 +26,7 @@ Item {
2626 property real progress: 0
2727 property var scope: null
2828 property var dashItemEater: {
29− if (tabBarHolder.currentTab == 0 && middleItems.count > 0) {
29+ if (tabBar.currentTab == 0 && middleItems.count > 0) {
3030 var loaderItem = middleItems.itemAt(0).item;
3131 return loaderItem && loaderItem.currentItem ? loaderItem.currentItem : null;
3232 }
@@ -38,6 +38,7 @@ Item {
3838 property QtObject scopeStyle: QtObject {
3939 property string headerLogo: ""
4040 property color foreground: "white"
41+ property color background: "transparent"
4142 }
4243 property size allCardSize: {
4344 if (middleItems.count > 1) {
@@ -67,7 +68,7 @@ Item {
6768
6869 onProgressChanged: {
6970 if (progress == 0) {
70− tabBarHolder.currentTab = 0;
71+ tabBar.currentTab = 0;
7172 }
7273 }
7374
@@ -96,7 +97,7 @@ Item {
9697 Item {
9798 id: topBar
9899 width: parent.width
99− height: childrenRect.height
100+ height: pageHeader.height + (tabBar.opacity == 1 ? tabBar.height + tabBar.anchors.margins : 0)
100101
101102 y: {
102103 if (root.progress < 0.5) {
@@ -118,7 +119,7 @@ Item {
118119 }
119120
120121 ScopesOverviewTab {
121− id: tabBarHolder
122+ id: tabBar
122123 anchors {
123124 left: parent.left
124125 right: parent.right
@@ -126,27 +127,31 @@ Item {
126127 margins: units.gu(2)
127128 }
128129 height: units.gu(4)
130+
131+ enabled: opacity == 1
132+ opacity: !scope || scope.searchQuery == "" ? 1 : 0
133+ Behavior on opacity { }
129134 }
130135 }
131136
132137 Repeater {
133138 id: middleItems
134− model: scope ? scope.categories : null
139+ model: scope && scope.searchQuery == "" ? scope.categories : null
135140 delegate: Loader {
136141 id: loader
137142
138143 height: {
139144 if (index == 0) {
140− return parent.height;
145+ return root.height;
141146 } else {
142− return parent.height - topBar.height - units.gu(2)
147+ return root.height - topBar.height - units.gu(2)
143148 }
144149 }
145150 width: {
146151 if (index == 0) {
147− return parent.width / scopeScale
152+ return root.width / scopeScale
148153 } else {
149− return parent.width
154+ return root.width
150155 }
151156 }
152157 x: {
@@ -157,7 +162,7 @@ Item {
157162 }
158163 }
159164 anchors {
160− bottom: parent.bottom
165+ bottom: scopesOverviewContent.bottom
161166 }
162167
163168 scale: index == 0 ? scopeScale : 1
@@ -166,7 +171,7 @@ Item {
166171 if (root.overrideOpacity >= 0)
167172 return root.overrideOpacity;
168173
169− if (tabBarHolder.currentTab != index)
174+ if (tabBar.currentTab != index)
170175 return 0;
171176
172177 return index == 0 ? 1 : root.progress;
@@ -189,12 +194,9 @@ Item {
189194 }
190195
191196 source: {
192− if (index == 0) return "ScopesOverviewFavourites.qml";
193− else if (index == 1) return "ScopesOverviewAll.qml";
194− else {
195− console.log("WARNING: ScopesOverview scope is not supposed to have more than 2 categories");
196− return "";
197− }
197+ if (index == 0 && categoryId == "favorites") return "ScopesOverviewFavorites.qml";
198+ else if (index == 1 && categoryId == "all") return "ScopesOverviewAll.qml";
199+ else return "";
198200 }
199201
200202 onLoaded: {
@@ -213,7 +215,7 @@ Item {
213215 Connections {
214216 target: loader.item
215217 onClicked: {
216− if (tabBarHolder.currentTab == 0) {
218+ if (tabBar.currentTab == 0) {
217219 root.favoriteSelected(index)
218220 } else {
219221 var favoriteScopesItem = middleItems.itemAt(0).item;
@@ -235,12 +237,31 @@ Item {
235237 }
236238 }
237239
240+ GenericScopeView {
241+ id: searchResultsViewer
242+ anchors {
243+ top: topBar.bottom
244+ right: parent.right
245+ left: parent.left
246+ bottom: parent.bottom
247+ }
248+ scope: root.scope && root.scope.searchQuery != "" ? root.scope : null
249+ scopeStyle: root.scopeStyle
250+ enabled: opacity == 1
251+ showPageHeader: false
252+ clip: true
253+ opacity: searchResultsViewer.scope ? 1 : 0
254+ Behavior on opacity { UbuntuNumberAnimation {} }
255+ }
256+
238257 Rectangle {
239258 id: bottomBar
240259 color: "black"
241260 height: units.gu(6)
242261 width: parent.width
243− opacity: 0.4
262+ enabled: opacity == 0.4
263+ opacity: scope && scope.searchQuery == "" ? 0.4 : 0
264+ Behavior on opacity { UbuntuNumberAnimation {} }
244265 y: {
245266 if (root.progress < 0.5) {
246267 return parent.height;