on xenial help sign in
Add support for "background-color" customization
914adf4Albert Astals
qml/Components/PageHeader.qml+9
@@ -36,6 +36,8 @@ Item {
36
36
37 property alias bottomItem: bottomContainer.children
37 property alias bottomItem: bottomContainer.children
38
38
39+ property alias backgroundColor: headerBackground.color
40+
39 signal backClicked()
41 signal backClicked()
40
42
41 function triggerSearch() {
43 function triggerSearch() {
@@ -112,6 +114,13 @@ Item {
112 }
114 }
113 }
115 }
114
116
117+ Rectangle {
118+ id: headerBackground
119+ anchors.fill: headersColumn
120+ color: "transparent"
121+ visible: color != "transparent"
122+ }
123+
115 Column {
124 Column {
116 id: headersColumn
125 id: headersColumn
117 anchors.fill: parent
126 anchors.fill: parent
qml/Dash/GenericScopeView.qml+1
@@ -319,6 +319,7 @@ FocusScope {
319 showBackButton: scopeView.hasBackAction
319 showBackButton: scopeView.hasBackAction
320 searchEntryEnabled: true
320 searchEntryEnabled: true
321 searchInProgress: root.scope.searchInProgress
321 searchInProgress: root.scope.searchInProgress
322+ backgroundColor: scopeView.scope && scopeView.scope.customizations["background-color"] || "transparent"
322
323
323 bottomItem: DashDepartments {
324 bottomItem: DashDepartments {
324 scope: scopeView.scope
325 scope: scopeView.scope
tests/mocks/Unity/fake_scope.cpp+5−1
@@ -157,7 +157,11 @@ bool Scope::hasDepartments() const
157
157
158QVariantMap Scope::customizations() const
158QVariantMap Scope::customizations() const
159{
159{
160− return QVariantMap();
160+ QVariantMap m;
161+ if (m_id == "clickscope") {
162+ m["background-color"] = "red";
163+ }
164+ return m;
161}
165}
162
166
163unity::shell::scopes::DepartmentInterface* Scope::getDepartment(const QString& id)
167unity::shell::scopes::DepartmentInterface* Scope::getDepartment(const QString& id)