@@ -26,7 +26,7 @@ Item {
26 property real progress: 0
26 property real progress: 0
27 property var scope: null
27 property var scope: null
28 property var dashItemEater: {
28 property var dashItemEater: {
29− if (tabBarHolder.currentTab == 0 && middleItems.count > 0) {
29+ if (tabBar.currentTab == 0 && middleItems.count > 0) {
30 var loaderItem = middleItems.itemAt(0).item;
30 var loaderItem = middleItems.itemAt(0).item;
31 return loaderItem && loaderItem.currentItem ? loaderItem.currentItem : null;
31 return loaderItem && loaderItem.currentItem ? loaderItem.currentItem : null;
@@ -38,6 +38,7 @@ Item {
38 property QtObject scopeStyle: QtObject {
38 property QtObject scopeStyle: QtObject {
39 property string headerLogo: ""
39 property string headerLogo: ""
40 property color foreground: "white"
40 property color foreground: "white"
41+ property color background: "transparent"
42 property size allCardSize: {
43 property size allCardSize: {
43 if (middleItems.count > 1) {
44 if (middleItems.count > 1) {
@@ -67,7 +68,7 @@ Item {
68 onProgressChanged: {
69 onProgressChanged: {
69 if (progress == 0) {
70 if (progress == 0) {
70− tabBarHolder.currentTab = 0;
71+ tabBar.currentTab = 0;
@@ -96,7 +97,7 @@ Item {
97 id: topBar
98 id: topBar
98 width: parent.width
99 width: parent.width
99− height: childrenRect.height
100+ height: pageHeader.height + (tabBar.opacity == 1 ? tabBar.height + tabBar.anchors.margins : 0)
102 if (root.progress < 0.5) {
103 if (root.progress < 0.5) {
@@ -118,7 +119,7 @@ Item {
120 ScopesOverviewTab {
121 ScopesOverviewTab {
121− id: tabBarHolder
122+ id: tabBar
122 anchors {
123 anchors {
123 left: parent.left
124 left: parent.left
124 right: parent.right
125 right: parent.right
@@ -126,27 +127,31 @@ Item {
126 margins: units.gu(2)
127 margins: units.gu(2)
128 height: units.gu(4)
129 height: units.gu(4)
131+ enabled: opacity == 1
132+ opacity: !scope || scope.searchQuery == "" ? 1 : 0
133+ Behavior on opacity { }
132 Repeater {
137 Repeater {
133 id: middleItems
138 id: middleItems
134− model: scope ? scope.categories : null
139+ model: scope && scope.searchQuery == "" ? scope.categories : null
135 delegate: Loader {
140 delegate: Loader {
136 id: loader
141 id: loader
138 height: {
143 height: {
139 if (index == 0) {
144 if (index == 0) {
140− return parent.height;
145+ return root.height;
142− return parent.height - topBar.height - units.gu(2)
147+ return root.height - topBar.height - units.gu(2)
146 if (index == 0) {
151 if (index == 0) {
147− return parent.width / scopeScale
152+ return root.width / scopeScale
149− return parent.width
154+ return root.width
@@ -157,7 +162,7 @@ Item {
159 anchors {
164 anchors {
160− bottom: parent.bottom
165+ bottom: scopesOverviewContent.bottom
163 scale: index == 0 ? scopeScale : 1
168 scale: index == 0 ? scopeScale : 1
@@ -166,7 +171,7 @@ Item {
166 if (root.overrideOpacity >= 0)
171 if (root.overrideOpacity >= 0)
167 return root.overrideOpacity;
172 return root.overrideOpacity;
169− if (tabBarHolder.currentTab != index)
174+ if (tabBar.currentTab != index)
170 return 0;
175 return 0;
172 return index == 0 ? 1 : root.progress;
177 return index == 0 ? 1 : root.progress;
@@ -189,12 +194,9 @@ Item {
191 source: {
196 source: {
192− if (index == 0) return "ScopesOverviewFavourites.qml";
197+ if (index == 0 && categoryId == "favorites") return "ScopesOverviewFavorites.qml";
193− else if (index == 1) return "ScopesOverviewAll.qml";
198+ else if (index == 1 && categoryId == "all") return "ScopesOverviewAll.qml";
195− console.log("WARNING: ScopesOverview scope is not supposed to have more than 2 categories");
196− return "";
199+ else return "";
200 onLoaded: {
202 onLoaded: {
@@ -213,7 +215,7 @@ Item {
213 Connections {
215 Connections {
214 target: loader.item
216 target: loader.item
215 onClicked: {
217 onClicked: {
216− if (tabBarHolder.currentTab == 0) {
218+ if (tabBar.currentTab == 0) {
217 root.favoriteSelected(index)
219 root.favoriteSelected(index)
219 var favoriteScopesItem = middleItems.itemAt(0).item;
221 var favoriteScopesItem = middleItems.itemAt(0).item;
@@ -235,12 +237,31 @@ Item {
241+ id: searchResultsViewer
246+ bottom: parent.bottom
248+ scope: root.scope && root.scope.searchQuery != "" ? root.scope : null
249+ scopeStyle: root.scopeStyle
250+ enabled: opacity == 1
251+ showPageHeader: false
253+ opacity: searchResultsViewer.scope ? 1 : 0
254+ Behavior on opacity { UbuntuNumberAnimation {} }
238 Rectangle {
257 Rectangle {
239 id: bottomBar
258 id: bottomBar
240 color: "black"
259 color: "black"
241 height: units.gu(6)
260 height: units.gu(6)
242 width: parent.width
261 width: parent.width
262+ enabled: opacity == 0.4
243− opacity: 0.4
263+ opacity: scope && scope.searchQuery == "" ? 0.4 : 0
264+ Behavior on opacity { UbuntuNumberAnimation {} }
245 if (root.progress < 0.5) {
266 if (root.progress < 0.5) {
246 return parent.height;
267 return parent.height;