on xenial help sign in
Use theme icons everywhere, apply colours to departments, too.
commit9ae5c891d734a5c17a1535517fff4ed1e9ba47fa authorMichał Sawicz <michal.sawicz@canonical.com> dateFri 4 Jul 2014, 13:39 (12 years ago) parent54ae052
4 files changed+21−18
qml/Dash/DashDepartments.qml+5−4 qml/Dash/DashDepartmentsList.qml+12−12 qml/Dash/GenericScopeView.qml+4−2 qml/Dash/graphics/tick@30.png
qml/Dash/DashDepartments.qml+5−4
@@ -29,6 +29,7 @@ AbstractButton {
2929
3030 property alias windowWidth: blackRect.width
3131 property alias windowHeight: blackRect.height
32+ property color backgroundColor: "white"
3233 property color foregroundColor: "gray"
3334
3435 // Are we drilling down the tree or up?
@@ -86,10 +87,9 @@ AbstractButton {
8687 anchors.verticalCenter: parent.verticalCenter
8788 anchors.right: parent.right
8889 anchors.rightMargin: units.gu(2)
89− rotation: showList ? 180 : 0
90− name: "dropdown-menu"
91− height: parent.height - units.gu(3)
92− width: units.gu(2)
90+ name: showList ? "up" : "down"
91+ height: units.gu(2)
92+ width: height
9393 color: root.foregroundColor
9494 }
9595
@@ -125,6 +125,7 @@ AbstractButton {
125125 objectName: "department" + index
126126 visible: height != 0
127127 width: departmentListView.width
128+ backgroundColor: root.backgroundColor
128129 foregroundColor: root.foregroundColor
129130 property real desiredHeight: {
130131 if (root.showList) {
qml/Dash/DashDepartmentsList.qml+12−12
@@ -22,6 +22,7 @@ Item {
2222 property var department: null
2323 property var currentDepartment: null
2424 property color foregroundColor: "gray"
25+ property color backgroundColor: "white"
2526 signal enterDepartment(var newDepartmentId, bool hasChildren)
2627 signal goBackToParentClicked()
2728 signal allDepartmentClicked()
@@ -31,7 +32,7 @@ Item {
3132
3233
3334 Rectangle {
34− color: "white"
35+ color: root.backgroundColor
3536 anchors.fill: parent
3637 }
3738
@@ -81,8 +82,8 @@ Item {
8182 leftMargin: units.gu(2)
8283 }
8384 name: "back"
84− height: parent.height - units.gu(3)
85− width: units.gu(2)
85+ height: units.gu(2)
86+ width: height
8687 color: root.foregroundColor
8788 }
8889
@@ -104,7 +105,7 @@ Item {
104105 leftMargin: units.gu(2)
105106 rightMargin: units.gu(2)
106107 }
107− color: "gray" // TODO Should this be root.foregroundColor ?
108+ color: root.foregroundColor
108109 opacity: 0.2
109110 height: units.dp(1)
110111 }
@@ -136,7 +137,7 @@ Item {
136137 leftMargin: units.gu(2)
137138 rightMargin: units.gu(2)
138139 }
139− color: "gray" // TODO Should this be root.foregroundColor ?
140+ color: root.foregroundColor
140141 opacity: 0.2
141142 height: units.dp(1)
142143 }
@@ -164,17 +165,16 @@ Item {
164165 color: root.foregroundColor
165166 }
166167
167− Image {
168− // TODO Use Icon here and use root.foregroundColor as keyColor
168+ Icon {
169169 anchors {
170170 verticalCenter: parent.verticalCenter
171171 right: parent.right
172172 rightMargin: units.gu(2)
173173 }
174− source: hasChildren ? "image://theme/chevron" : "graphics/tick.png"
175− sourceSize.height: parent.height - units.gu(3)
176− sourceSize.width: units.gu(3)
177− fillMode: Image.PreserveAspectFit
174+ height: units.gu(2)
175+ width: height
176+ name: hasChildren ? "go-next" : "tick"
177+ color: root.foregroundColor
178178 visible: hasChildren || isActive
179179 }
180180
@@ -186,7 +186,7 @@ Item {
186186 leftMargin: units.gu(2)
187187 rightMargin: units.gu(2)
188188 }
189− color: "gray" // TODO Should this be root.foregroundColor ?
189+ color: root.foregroundColor
190190 opacity: 0.1
191191 height: units.dp(1)
192192 visible: index != department.count - 1
qml/Dash/GenericScopeView.qml+4−2
@@ -34,7 +34,9 @@ FocusScope {
3434 property bool hasBackAction: false
3535 property bool enableHeightBehaviorOnNextCreation: false
3636 property var categoryView: categoryView
37+ // TODO Should be taken from the theme
3738 property color foregroundColor: scope && scope.customizations["foreground-color"] || "grey"
39+ property color backgroundColor: scope && scope.customizations["background-color"] || "transparent"
3840
3941 signal backClicked()
4042
@@ -99,7 +101,7 @@ FocusScope {
99101 Rectangle {
100102 id: headerBackground
101103 anchors.fill: parent
102− color: scopeView.scope && scopeView.scope.customizations["background-color"] || "transparent"
104+ color: scopeView.backgroundColor
103105 visible: color != "transparent"
104106 }
105107
@@ -336,7 +338,7 @@ FocusScope {
336338 windowHeight: scopeView.height
337339 windowWidth: scopeView.width
338340 foregroundColor: scopeView.foregroundColor
339− // TODO Should we move the background color over the deparments combo too?
341+ backgroundColor: scopeView.backgroundColor === Qt.rgba(0, 0, 0, 0) ? "white" : scopeView.backgroundColor
340342 }
341343
342344 onBackClicked: scopeView.backClicked()
qml/Dash/graphics/tick@30.pngdeleted

Binary file not shown.