on xenial help sign in
Add support for "background-color" customization
commit914adf4d6236de88dedc4bfa1aca9af89b900ad8 authorAlbert Astals <albert.astals@canonical.com> dateTue 1 Jul 2014, 15:50 (12 years ago) parenta89d74f
3 files changed+15−1
qml/Components/PageHeader.qml+9 qml/Dash/GenericScopeView.qml+1 tests/mocks/Unity/fake_scope.cpp+5−1
qml/Components/PageHeader.qml+9
@@ -36,6 +36,8 @@ Item {
3636
3737 property alias bottomItem: bottomContainer.children
3838
39+ property alias backgroundColor: headerBackground.color
40+
3941 signal backClicked()
4042
4143 function triggerSearch() {
@@ -112,6 +114,13 @@ Item {
112114 }
113115 }
114116
117+ Rectangle {
118+ id: headerBackground
119+ anchors.fill: headersColumn
120+ color: "transparent"
121+ visible: color != "transparent"
122+ }
123+
115124 Column {
116125 id: headersColumn
117126 anchors.fill: parent
qml/Dash/GenericScopeView.qml+1
@@ -319,6 +319,7 @@ FocusScope {
319319 showBackButton: scopeView.hasBackAction
320320 searchEntryEnabled: true
321321 searchInProgress: root.scope.searchInProgress
322+ backgroundColor: scopeView.scope && scopeView.scope.customizations["background-color"] || "transparent"
322323
323324 bottomItem: DashDepartments {
324325 scope: scopeView.scope
tests/mocks/Unity/fake_scope.cpp+5−1
@@ -157,7 +157,11 @@ bool Scope::hasDepartments() const
157157
158158QVariantMap Scope::customizations() const
159159{
160− return QVariantMap();
160+ QVariantMap m;
161+ if (m_id == "clickscope") {
162+ m["background-color"] = "red";
163+ }
164+ return m;
161165}
162166
163167unity::shell::scopes::DepartmentInterface* Scope::getDepartment(const QString& id)