@@ -19,6 +19,7 @@ import Ubuntu.Components 0.1
1919import Utils 0.1
2020import Unity 0.2
2121import Unity.Application 0.1
22+import Dash 0.1
2223import "../Components"
2324import "../Components/ListItems" as ListItems
2425
@@ -33,9 +34,10 @@ FocusScope {
3334 property bool hasBackAction: false
3435 property bool enableHeightBehaviorOnNextCreation: false
3536 property var categoryView: categoryView
36− // TODO Should be taken from the theme
37− property color foregroundColor: scope && scope.customizations["foreground-color"] || "grey"
38− property color backgroundColor: scope && scope.customizations["background-color"] || "transparent"
37+
38+ property var styleTool: StyleTool {
39+ style: scope ? scope.customizations : {}
40+ }
3941
4042 signal backClicked()
4143
@@ -103,7 +105,7 @@ FocusScope {
103105
104106 Rectangle {
105107 anchors.fill: parent
106− color: scopeView.backgroundColor
108+ color: scopeView.styleTool.background
107109 visible: color != "transparent"
108110 }
109111
@@ -174,7 +176,7 @@ FocusScope {
174176 item.model = Qt.binding(function() { return results })
175177 }
176178 item.objectName = Qt.binding(function() { return categoryId })
177− item.foregroundColor = Qt.binding(function() { return scopeView.foregroundColor })
179+ item.styleTool = scopeView.styleTool;
178180 if (item.expandable) {
179181 var shouldFilter = categoryId != categoryView.expandedCategoryId;
180182 item.setFilter(shouldFilter, false /*animate*/);
@@ -314,7 +316,7 @@ FocusScope {
314316 property var delegate: categoryView.item(delegateIndex)
315317 width: categoryView.width
316318 text: section
317− textColor: foregroundColor
319+ textColor: styleTool.foreground
318320 image: {
319321 if (delegate && delegate.expandable)
320322 return delegate.filtered ? "graphics/header_handlearrow.png" : "graphics/header_handlearrow2.png"
@@ -335,8 +337,7 @@ FocusScope {
335337 showBackButton: scopeView.hasBackAction
336338 searchEntryEnabled: true
337339 searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false
338− foregroundColor: scopeView.foregroundColor
339− imageSource: scopeView.scope && scopeView.scope.customizations["page-header"] && scopeView.scope.customizations["page-header"]["logo"] || ""
340+ styleTool: scopeView.styleTool
340341
341342 bottomItem: DashDepartments {
342343 scope: scopeView.scope
@@ -344,8 +345,7 @@ FocusScope {
344345 anchors.right: parent.right
345346 windowHeight: scopeView.height
346347 windowWidth: scopeView.width
347− foregroundColor: scopeView.foregroundColor
348− backgroundColor: scopeView.backgroundColor === Qt.rgba(0, 0, 0, 0) ? "white" : scopeView.backgroundColor
348+ styleTool: scopeView.styleTool
349349 }
350350
351351 onBackClicked: scopeView.backClicked()
@@ -357,6 +357,7 @@ FocusScope {
357357 objectName: "previewListView"
358358 visible: x != width
359359 scope: scopeView.scope
360+ styleTool: scopeView.styleTool
360361 width: parent.width
361362 height: parent.height
362363 anchors.left: categoryView.right