on xenial help sign in
Use theme icons everywhere, apply colours to departments, too.
9ae5c89Michał Sawicz
qml/Dash/DashDepartments.qml+5−4
@@ -29,6 +29,7 @@ AbstractButton {
29
29
30 property alias windowWidth: blackRect.width
30 property alias windowWidth: blackRect.width
31 property alias windowHeight: blackRect.height
31 property alias windowHeight: blackRect.height
32+ property color backgroundColor: "white"
32 property color foregroundColor: "gray"
33 property color foregroundColor: "gray"
33
34
34 // Are we drilling down the tree or up?
35 // Are we drilling down the tree or up?
@@ -86,10 +87,9 @@ AbstractButton {
86 anchors.verticalCenter: parent.verticalCenter
87 anchors.verticalCenter: parent.verticalCenter
87 anchors.right: parent.right
88 anchors.right: parent.right
88 anchors.rightMargin: units.gu(2)
89 anchors.rightMargin: units.gu(2)
89− rotation: showList ? 180 : 0
90+ name: showList ? "up" : "down"
90− name: "dropdown-menu"
91− height: parent.height - units.gu(3)
91+ height: units.gu(2)
92− width: units.gu(2)
92+ width: height
93 color: root.foregroundColor
93 color: root.foregroundColor
94 }
94 }
95
95
@@ -125,6 +125,7 @@ AbstractButton {
125 objectName: "department" + index
125 objectName: "department" + index
126 visible: height != 0
126 visible: height != 0
127 width: departmentListView.width
127 width: departmentListView.width
128+ backgroundColor: root.backgroundColor
128 foregroundColor: root.foregroundColor
129 foregroundColor: root.foregroundColor
129 property real desiredHeight: {
130 property real desiredHeight: {
130 if (root.showList) {
131 if (root.showList) {
qml/Dash/DashDepartmentsList.qml+12−12
@@ -22,6 +22,7 @@ Item {
22 property var department: null
22 property var department: null
23 property var currentDepartment: null
23 property var currentDepartment: null
24 property color foregroundColor: "gray"
24 property color foregroundColor: "gray"
25+ property color backgroundColor: "white"
25 signal enterDepartment(var newDepartmentId, bool hasChildren)
26 signal enterDepartment(var newDepartmentId, bool hasChildren)
26 signal goBackToParentClicked()
27 signal goBackToParentClicked()
27 signal allDepartmentClicked()
28 signal allDepartmentClicked()
@@ -31,7 +32,7 @@ Item {
31
32
32
33
33 Rectangle {
34 Rectangle {
34− color: "white"
35+ color: root.backgroundColor
35 anchors.fill: parent
36 anchors.fill: parent
36 }
37 }
37
38
@@ -81,8 +82,8 @@ Item {
81 leftMargin: units.gu(2)
82 leftMargin: units.gu(2)
82 }
83 }
83 name: "back"
84 name: "back"
84− height: parent.height - units.gu(3)
85+ height: units.gu(2)
85− width: units.gu(2)
86+ width: height
86 color: root.foregroundColor
87 color: root.foregroundColor
87 }
88 }
88
89
@@ -104,7 +105,7 @@ Item {
104 leftMargin: units.gu(2)
105 leftMargin: units.gu(2)
105 rightMargin: units.gu(2)
106 rightMargin: units.gu(2)
106 }
107 }
107− color: "gray" // TODO Should this be root.foregroundColor ?
108+ color: root.foregroundColor
108 opacity: 0.2
109 opacity: 0.2
109 height: units.dp(1)
110 height: units.dp(1)
110 }
111 }
@@ -136,7 +137,7 @@ Item {
136 leftMargin: units.gu(2)
137 leftMargin: units.gu(2)
137 rightMargin: units.gu(2)
138 rightMargin: units.gu(2)
138 }
139 }
139− color: "gray" // TODO Should this be root.foregroundColor ?
140+ color: root.foregroundColor
140 opacity: 0.2
141 opacity: 0.2
141 height: units.dp(1)
142 height: units.dp(1)
142 }
143 }
@@ -164,17 +165,16 @@ Item {
164 color: root.foregroundColor
165 color: root.foregroundColor
165 }
166 }
166
167
167− Image {
168+ Icon {
168− // TODO Use Icon here and use root.foregroundColor as keyColor
169 anchors {
169 anchors {
170 verticalCenter: parent.verticalCenter
170 verticalCenter: parent.verticalCenter
171 right: parent.right
171 right: parent.right
172 rightMargin: units.gu(2)
172 rightMargin: units.gu(2)
173 }
173 }
174+ height: units.gu(2)
175+ width: height
174− source: hasChildren ? "image://theme/chevron" : "graphics/tick.png"
176+ name: hasChildren ? "go-next" : "tick"
175− sourceSize.height: parent.height - units.gu(3)
177+ color: root.foregroundColor
176− sourceSize.width: units.gu(3)
177− fillMode: Image.PreserveAspectFit
178 visible: hasChildren || isActive
178 visible: hasChildren || isActive
179 }
179 }
180
180
@@ -186,7 +186,7 @@ Item {
186 leftMargin: units.gu(2)
186 leftMargin: units.gu(2)
187 rightMargin: units.gu(2)
187 rightMargin: units.gu(2)
188 }
188 }
189− color: "gray" // TODO Should this be root.foregroundColor ?
189+ color: root.foregroundColor
190 opacity: 0.1
190 opacity: 0.1
191 height: units.dp(1)
191 height: units.dp(1)
192 visible: index != department.count - 1
192 visible: index != department.count - 1
qml/Dash/GenericScopeView.qml+4−2
@@ -34,7 +34,9 @@ FocusScope {
34 property bool hasBackAction: false
34 property bool hasBackAction: false
35 property bool enableHeightBehaviorOnNextCreation: false
35 property bool enableHeightBehaviorOnNextCreation: false
36 property var categoryView: categoryView
36 property var categoryView: categoryView
37+ // TODO Should be taken from the theme
37 property color foregroundColor: scope && scope.customizations["foreground-color"] || "grey"
38 property color foregroundColor: scope && scope.customizations["foreground-color"] || "grey"
39+ property color backgroundColor: scope && scope.customizations["background-color"] || "transparent"
38
40
39 signal backClicked()
41 signal backClicked()
40
42
@@ -99,7 +101,7 @@ FocusScope {
99 Rectangle {
101 Rectangle {
100 id: headerBackground
102 id: headerBackground
101 anchors.fill: parent
103 anchors.fill: parent
102− color: scopeView.scope && scopeView.scope.customizations["background-color"] || "transparent"
104+ color: scopeView.backgroundColor
103 visible: color != "transparent"
105 visible: color != "transparent"
104 }
106 }
105
107
@@ -336,7 +338,7 @@ FocusScope {
336 windowHeight: scopeView.height
338 windowHeight: scopeView.height
337 windowWidth: scopeView.width
339 windowWidth: scopeView.width
338 foregroundColor: scopeView.foregroundColor
340 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
340 }
342 }
341
343
342 onBackClicked: scopeView.backClicked()
344 onBackClicked: scopeView.backClicked()
qml/Dash/graphics/tick@30.pngdeleted

Binary file not shown.