on xenial help sign in
Some more applying of the customization
1547577Albert Astals
plugins/Dash/CardCreator.js+4−3
@@ -289,6 +289,7 @@ function cardString(template, components) {
289 property var cardData; \n\
289 property var cardData; \n\
290 property var artShapeBorderSource: undefined; \n\
290 property var artShapeBorderSource: undefined; \n\
291 property real fontScale: 1.0; \n\
291 property real fontScale: 1.0; \n\
292+ property color foregroundColor: "gray"; \n\
292 property int headerAlignment: Text.AlignLeft; \n\
293 property int headerAlignment: Text.AlignLeft; \n\
293 property int fixedHeaderHeight: -1; \n\
294 property int fixedHeaderHeight: -1; \n\
294 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
295 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
@@ -407,7 +408,7 @@ function cardString(template, components) {
407 mascotCode = kMascotImageCode.arg(anchors).arg(mascotImageVisible);
408 mascotCode = kMascotImageCode.arg(anchors).arg(mascotImageVisible);
408 }
409 }
409
410
410− var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : "grey"';
411+ var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : root.foregroundColor';
411
412
412 var titleSubtitleCode = "";
413 var titleSubtitleCode = "";
413 if (hasTitle) {
414 if (hasTitle) {
@@ -419,7 +420,7 @@ function cardString(template, components) {
419 } else if (hasBackground) {
420 } else if (hasBackground) {
420 color = summaryColorWithBackground;
421 color = summaryColorWithBackground;
421 } else {
422 } else {
422− color = '"grey"';
423+ color = 'root.foregroundColor';
423 }
424 }
424
425
425 var titleAnchors;
426 var titleAnchors;
@@ -495,7 +496,7 @@ function cardString(template, components) {
495 if (hasBackground) {
496 if (hasBackground) {
496 color = summaryColorWithBackground;
497 color = summaryColorWithBackground;
497 } else {
498 } else {
498− color = '"grey"';
499+ color = 'root.foregroundColor';
499 }
500 }
500
501
501 var summaryTopMargin = (hasMascot || hasSubtitle ? 'anchors.margins' : '0');
502 var summaryTopMargin = (hasMascot || hasSubtitle ? 'anchors.margins' : '0');
qml/Components/ListItems/Header.qml+1
@@ -24,6 +24,7 @@ Item {
24 \qmlproperty string text
24 \qmlproperty string text
25 */
25 */
26 property alias text: label.text
26 property alias text: label.text
27+ property alias textColor: label.color
27 property alias image: image.source
28 property alias image: image.source
28
29
29 signal clicked(variant mouse)
30 signal clicked(variant mouse)
qml/Components/PageHeader.qml−9
@@ -35,8 +35,6 @@ Item {
35 property bool searchInProgress: false
35 property bool searchInProgress: false
36
36
37 property alias bottomItem: bottomContainer.children
37 property alias bottomItem: bottomContainer.children
38−
39− property alias backgroundColor: headerBackground.color
40 // TODO We should use foregroundColor for the icons
38 // TODO We should use foregroundColor for the icons
41 // of the toolbar but unfortunately Action does not have
39 // of the toolbar but unfortunately Action does not have
42 // the keyColor property as Icon does :-/
40 // the keyColor property as Icon does :-/
@@ -118,13 +116,6 @@ Item {
118 }
116 }
119 }
117 }
120
118
121− Rectangle {
122− id: headerBackground
123− anchors.fill: headersColumn
124− color: "transparent"
125− visible: color != "transparent"
126− }
127−
128 Column {
119 Column {
129 id: headersColumn
120 id: headersColumn
130 anchors.fill: parent
121 anchors.fill: parent
qml/Dash/CardCarousel.qml+1
@@ -64,6 +64,7 @@ DashRenderer {
64 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
64 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
65 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
65 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
66 item.artShapeBorderSource = "none";
66 item.artShapeBorderSource = "none";
67+ item.foregroundColor = Qt.binding(function() { return cardCarousel.foregroundColor; });
67 }
68 }
68
69
69 BorderImage {
70 BorderImage {
qml/Dash/CardFilterGrid.qml+1
@@ -58,6 +58,7 @@ DashRenderer {
58 item.template = Qt.binding(function() { return cardTool.template; });
58 item.template = Qt.binding(function() { return cardTool.template; });
59 item.components = Qt.binding(function() { return cardTool.components; });
59 item.components = Qt.binding(function() { return cardTool.components; });
60 item.headerAlignment = Qt.binding(function() { return cardTool.headerAlignment; });
60 item.headerAlignment = Qt.binding(function() { return cardTool.headerAlignment; });
61+ item.foregroundColor = Qt.binding(function() { return genericFilterGrid.foregroundColor; });
61 }
62 }
62 Connections {
63 Connections {
63 target: loader.item
64 target: loader.item
qml/Dash/CardVerticalJournal.qml+1
@@ -75,6 +75,7 @@ DashRenderer {
75 item.template = Qt.binding(function() { return cardTool.template; });
75 item.template = Qt.binding(function() { return cardTool.template; });
76 item.components = Qt.binding(function() { return cardTool.components; });
76 item.components = Qt.binding(function() { return cardTool.components; });
77 item.headerAlignment = Qt.binding(function() { return cardTool.headerAlignment; });
77 item.headerAlignment = Qt.binding(function() { return cardTool.headerAlignment; });
78+ item.foregroundColor = Qt.binding(function() { return root.foregroundColor; });
78 }
79 }
79 Connections {
80 Connections {
80 target: loader.item
81 target: loader.item
qml/Dash/DashDepartments.qml+4−1
@@ -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 foregroundColor: "gray"
32
33
33 // Are we drilling down the tree or up?
34 // Are we drilling down the tree or up?
34 property bool isGoingBack: false
35 property bool isGoingBack: false
@@ -78,10 +79,11 @@ AbstractButton {
78 anchors.margins: units.gu(2)
79 anchors.margins: units.gu(2)
79 verticalAlignment: Text.AlignVCenter
80 verticalAlignment: Text.AlignVCenter
80 text: root.currentDepartment ? root.currentDepartment.label : ""
81 text: root.currentDepartment ? root.currentDepartment.label : ""
81− color: "gray" // TODO remove once we're a separate app
82+ color: root.foregroundColor
82 }
83 }
83
84
84 Image {
85 Image {
86+ // TODO Use Icon here and use root.foregroundColor as keyColor
85 anchors.verticalCenter: parent.verticalCenter
87 anchors.verticalCenter: parent.verticalCenter
86 anchors.right: parent.right
88 anchors.right: parent.right
87 anchors.rightMargin: units.gu(2)
89 anchors.rightMargin: units.gu(2)
@@ -124,6 +126,7 @@ AbstractButton {
124 objectName: "department" + index
126 objectName: "department" + index
125 visible: height != 0
127 visible: height != 0
126 width: departmentListView.width
128 width: departmentListView.width
129+ foregroundColor: root.foregroundColor
127 property real desiredHeight: {
130 property real desiredHeight: {
128 if (root.showList) {
131 if (root.showList) {
129 if (department && department.loaded && x == departmentListView.contentX)
132 if (department && department.loaded && x == departmentListView.contentX)
qml/Dash/DashDepartmentsList.qml+10−6
@@ -21,6 +21,7 @@ Item {
21 id: root
21 id: root
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 signal enterDepartment(var newDepartmentId, bool hasChildren)
25 signal enterDepartment(var newDepartmentId, bool hasChildren)
25 signal goBackToParentClicked()
26 signal goBackToParentClicked()
26 signal allDepartmentClicked()
27 signal allDepartmentClicked()
@@ -28,6 +29,7 @@ Item {
28 readonly property int itemHeight: units.gu(5)
29 readonly property int itemHeight: units.gu(5)
29 implicitHeight: flickable.contentHeight
30 implicitHeight: flickable.contentHeight
30
31
32+
31 Rectangle {
33 Rectangle {
32 color: "white"
34 color: "white"
33 anchors.fill: parent
35 anchors.fill: parent
@@ -72,6 +74,7 @@ Item {
72 onClicked: root.goBackToParentClicked();
74 onClicked: root.goBackToParentClicked();
73
75
74 Image {
76 Image {
77+ // TODO Use Icon here and use root.foregroundColor as keyColor
75 id: backImage
78 id: backImage
76 anchors {
79 anchors {
77 verticalCenter: parent.verticalCenter
80 verticalCenter: parent.verticalCenter
@@ -91,7 +94,7 @@ Item {
91 leftMargin: units.gu(0.5)
94 leftMargin: units.gu(0.5)
92 }
95 }
93 text: department ? department.parentLabel : ""
96 text: department ? department.parentLabel : ""
94− color: "gray" // TODO remove once we're a separate app
97+ color: root.foregroundColor
95 }
98 }
96
99
97 Rectangle {
100 Rectangle {
@@ -102,7 +105,7 @@ Item {
102 leftMargin: units.gu(2)
105 leftMargin: units.gu(2)
103 rightMargin: units.gu(2)
106 rightMargin: units.gu(2)
104 }
107 }
105− color: "gray"
108+ color: "gray" // TODO Should this be root.foregroundColor ?
106 opacity: 0.2
109 opacity: 0.2
107 height: units.dp(1)
110 height: units.dp(1)
108 }
111 }
@@ -123,7 +126,7 @@ Item {
123 }
126 }
124 text: department ? (department.allLabel != "" ? department.allLabel : department.label) : ""
127 text: department ? (department.allLabel != "" ? department.allLabel : department.label) : ""
125 font.bold: true
128 font.bold: true
126− color: "gray" // TODO remove once we're a separate app
129+ color: root.foregroundColor
127 }
130 }
128
131
129 Rectangle {
132 Rectangle {
@@ -134,7 +137,7 @@ Item {
134 leftMargin: units.gu(2)
137 leftMargin: units.gu(2)
135 rightMargin: units.gu(2)
138 rightMargin: units.gu(2)
136 }
139 }
137− color: "gray"
140+ color: "gray" // TODO Should this be root.foregroundColor ?
138 opacity: 0.2
141 opacity: 0.2
139 height: units.dp(1)
142 height: units.dp(1)
140 }
143 }
@@ -159,10 +162,11 @@ Item {
159 leftMargin: units.gu(2)
162 leftMargin: units.gu(2)
160 }
163 }
161 text: label
164 text: label
162− color: "gray" // TODO remove once we're a separate app
165+ color: root.foregroundColor
163 }
166 }
164
167
165 Image {
168 Image {
169+ // TODO Use Icon here and use root.foregroundColor as keyColor
166 anchors {
170 anchors {
167 verticalCenter: parent.verticalCenter
171 verticalCenter: parent.verticalCenter
168 right: parent.right
172 right: parent.right
@@ -183,7 +187,7 @@ Item {
183 leftMargin: units.gu(2)
187 leftMargin: units.gu(2)
184 rightMargin: units.gu(2)
188 rightMargin: units.gu(2)
185 }
189 }
186− color: "gray"
190+ color: "gray" // TODO Should this be root.foregroundColor ?
187 opacity: 0.1
191 opacity: 0.1
188 height: units.dp(1)
192 height: units.dp(1)
189 visible: index != department.count - 1
193 visible: index != department.count - 1
qml/Dash/DashRenderer.qml+2
@@ -33,6 +33,8 @@ Item {
33
33
34 property real originY: 0
34 property real originY: 0
35
35
36+ property color foregroundColor: "gray"
37+
36 // The model to renderer
38 // The model to renderer
37 property var model
39 property var model
38
40
qml/Dash/GenericScopeView.qml+13−2
@@ -36,6 +36,7 @@ FocusScope {
36 property ListModel searchHistory
36 property ListModel searchHistory
37 property bool enableHeightBehaviorOnNextCreation: false
37 property bool enableHeightBehaviorOnNextCreation: false
38 property var categoryView: categoryView
38 property var categoryView: categoryView
39+ property color foregroundColor: scope && scope.customizations["foreground-color"] || "grey"
39
40
40 signal backClicked()
41 signal backClicked()
41
42
@@ -97,6 +98,13 @@ FocusScope {
97 onHideDash: previewListView.open = false;
98 onHideDash: previewListView.open = false;
98 }
99 }
99
100
101+ Rectangle {
102+ id: headerBackground
103+ anchors.fill: parent
104+ color: scopeView.scope && scopeView.scope.customizations["background-color"] || "transparent"
105+ visible: color != "transparent"
106+ }
107+
100 ScopeListView {
108 ScopeListView {
101 id: categoryView
109 id: categoryView
102 objectName: "categoryListView"
110 objectName: "categoryListView"
@@ -159,6 +167,7 @@ FocusScope {
159 item.model = Qt.binding(function() { return results })
167 item.model = Qt.binding(function() { return results })
160 }
168 }
161 item.objectName = Qt.binding(function() { return categoryId })
169 item.objectName = Qt.binding(function() { return categoryId })
170+ item.foregroundColor = Qt.binding(function() { return scopeView.foregroundColor })
162 if (item.expandable) {
171 if (item.expandable) {
163 var shouldFilter = categoryId != categoryView.expandedCategoryId;
172 var shouldFilter = categoryId != categoryView.expandedCategoryId;
164 item.setFilter(shouldFilter, false /*animate*/);
173 item.setFilter(shouldFilter, false /*animate*/);
@@ -298,6 +307,7 @@ FocusScope {
298 property var delegate: categoryView.item(delegateIndex)
307 property var delegate: categoryView.item(delegateIndex)
299 width: categoryView.width
308 width: categoryView.width
300 text: section
309 text: section
310+ textColor: foregroundColor
301 image: {
311 image: {
302 if (delegate && delegate.expandable)
312 if (delegate && delegate.expandable)
303 return delegate.filtered ? "graphics/header_handlearrow.png" : "graphics/header_handlearrow2.png"
313 return delegate.filtered ? "graphics/header_handlearrow.png" : "graphics/header_handlearrow2.png"
@@ -319,8 +329,7 @@ FocusScope {
319 showBackButton: scopeView.hasBackAction
329 showBackButton: scopeView.hasBackAction
320 searchEntryEnabled: true
330 searchEntryEnabled: true
321 searchInProgress: root.scope.searchInProgress
331 searchInProgress: root.scope.searchInProgress
322− backgroundColor: scopeView.scope && scopeView.scope.customizations["background-color"] || "transparent"
332+ foregroundColor: scopeView.foregroundColor
323− foregroundColor: scopeView.scope && scopeView.scope.customizations["foreground-color"] || "grey"
324 imageSource: scopeView.scope && scopeView.scope.customizations["page-header"] && scopeView.scope.customizations["page-header"]["logo"] || ""
333 imageSource: scopeView.scope && scopeView.scope.customizations["page-header"] && scopeView.scope.customizations["page-header"]["logo"] || ""
325
334
326 bottomItem: DashDepartments {
335 bottomItem: DashDepartments {
@@ -329,6 +338,8 @@ FocusScope {
329 anchors.right: parent.right
338 anchors.right: parent.right
330 windowHeight: scopeView.height
339 windowHeight: scopeView.height
331 windowWidth: scopeView.width
340 windowWidth: scopeView.width
341+ foregroundColor: scopeView.foregroundColor
342+ // TODO Should we move the background color over the deparments combo too?
332 }
343 }
333
344
334 onBackClicked: scopeView.backClicked()
345 onBackClicked: scopeView.backClicked()