on xenial help sign in
Some more applying of the customization
commit1547577962b34ead3738f651512a3a7bbc9b77f1 authorAlbert Astals <albert.astals@canonical.com> dateTue 1 Jul 2014, 16:44 (12 years ago) parent3ef1933
10 files changed+37−21
plugins/Dash/CardCreator.js+4−3 qml/Components/ListItems/Header.qml+1 qml/Components/PageHeader.qml−9 qml/Dash/CardCarousel.qml+1 qml/Dash/CardFilterGrid.qml+1 qml/Dash/CardVerticalJournal.qml+1 qml/Dash/DashDepartments.qml+4−1 qml/Dash/DashDepartmentsList.qml+10−6 qml/Dash/DashRenderer.qml+2 qml/Dash/GenericScopeView.qml+13−2
plugins/Dash/CardCreator.js+4−3
@@ -289,6 +289,7 @@ function cardString(template, components) {
289289 property var cardData; \n\
290290 property var artShapeBorderSource: undefined; \n\
291291 property real fontScale: 1.0; \n\
292+ property color foregroundColor: "gray"; \n\
292293 property int headerAlignment: Text.AlignLeft; \n\
293294 property int fixedHeaderHeight: -1; \n\
294295 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
@@ -407,7 +408,7 @@ function cardString(template, components) {
407408 mascotCode = kMascotImageCode.arg(anchors).arg(mascotImageVisible);
408409 }
409410
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';
411412
412413 var titleSubtitleCode = "";
413414 if (hasTitle) {
@@ -419,7 +420,7 @@ function cardString(template, components) {
419420 } else if (hasBackground) {
420421 color = summaryColorWithBackground;
421422 } else {
422− color = '"grey"';
423+ color = 'root.foregroundColor';
423424 }
424425
425426 var titleAnchors;
@@ -495,7 +496,7 @@ function cardString(template, components) {
495496 if (hasBackground) {
496497 color = summaryColorWithBackground;
497498 } else {
498− color = '"grey"';
499+ color = 'root.foregroundColor';
499500 }
500501
501502 var summaryTopMargin = (hasMascot || hasSubtitle ? 'anchors.margins' : '0');
qml/Components/ListItems/Header.qml+1
@@ -24,6 +24,7 @@ Item {
2424 \qmlproperty string text
2525 */
2626 property alias text: label.text
27+ property alias textColor: label.color
2728 property alias image: image.source
2829
2930 signal clicked(variant mouse)
qml/Components/PageHeader.qml−9
@@ -35,8 +35,6 @@ Item {
3535 property bool searchInProgress: false
3636
3737 property alias bottomItem: bottomContainer.children
38−
39− property alias backgroundColor: headerBackground.color
4038 // TODO We should use foregroundColor for the icons
4139 // of the toolbar but unfortunately Action does not have
4240 // the keyColor property as Icon does :-/
@@ -118,13 +116,6 @@ Item {
118116 }
119117 }
120118
121− Rectangle {
122− id: headerBackground
123− anchors.fill: headersColumn
124− color: "transparent"
125− visible: color != "transparent"
126− }
127−
128119 Column {
129120 id: headersColumn
130121 anchors.fill: parent
qml/Dash/CardCarousel.qml+1
@@ -64,6 +64,7 @@ DashRenderer {
6464 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
6565 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
6666 item.artShapeBorderSource = "none";
67+ item.foregroundColor = Qt.binding(function() { return cardCarousel.foregroundColor; });
6768 }
6869
6970 BorderImage {
qml/Dash/CardFilterGrid.qml+1
@@ -58,6 +58,7 @@ DashRenderer {
5858 item.template = Qt.binding(function() { return cardTool.template; });
5959 item.components = Qt.binding(function() { return cardTool.components; });
6060 item.headerAlignment = Qt.binding(function() { return cardTool.headerAlignment; });
61+ item.foregroundColor = Qt.binding(function() { return genericFilterGrid.foregroundColor; });
6162 }
6263 Connections {
6364 target: loader.item
qml/Dash/CardVerticalJournal.qml+1
@@ -75,6 +75,7 @@ DashRenderer {
7575 item.template = Qt.binding(function() { return cardTool.template; });
7676 item.components = Qt.binding(function() { return cardTool.components; });
7777 item.headerAlignment = Qt.binding(function() { return cardTool.headerAlignment; });
78+ item.foregroundColor = Qt.binding(function() { return root.foregroundColor; });
7879 }
7980 Connections {
8081 target: loader.item
qml/Dash/DashDepartments.qml+4−1
@@ -29,6 +29,7 @@ AbstractButton {
2929
3030 property alias windowWidth: blackRect.width
3131 property alias windowHeight: blackRect.height
32+ property color foregroundColor: "gray"
3233
3334 // Are we drilling down the tree or up?
3435 property bool isGoingBack: false
@@ -78,10 +79,11 @@ AbstractButton {
7879 anchors.margins: units.gu(2)
7980 verticalAlignment: Text.AlignVCenter
8081 text: root.currentDepartment ? root.currentDepartment.label : ""
81− color: "gray" // TODO remove once we're a separate app
82+ color: root.foregroundColor
8283 }
8384
8485 Image {
86+ // TODO Use Icon here and use root.foregroundColor as keyColor
8587 anchors.verticalCenter: parent.verticalCenter
8688 anchors.right: parent.right
8789 anchors.rightMargin: units.gu(2)
@@ -124,6 +126,7 @@ AbstractButton {
124126 objectName: "department" + index
125127 visible: height != 0
126128 width: departmentListView.width
129+ foregroundColor: root.foregroundColor
127130 property real desiredHeight: {
128131 if (root.showList) {
129132 if (department && department.loaded && x == departmentListView.contentX)
qml/Dash/DashDepartmentsList.qml+10−6
@@ -21,6 +21,7 @@ Item {
2121 id: root
2222 property var department: null
2323 property var currentDepartment: null
24+ property color foregroundColor: "gray"
2425 signal enterDepartment(var newDepartmentId, bool hasChildren)
2526 signal goBackToParentClicked()
2627 signal allDepartmentClicked()
@@ -28,6 +29,7 @@ Item {
2829 readonly property int itemHeight: units.gu(5)
2930 implicitHeight: flickable.contentHeight
3031
32+
3133 Rectangle {
3234 color: "white"
3335 anchors.fill: parent
@@ -72,6 +74,7 @@ Item {
7274 onClicked: root.goBackToParentClicked();
7375
7476 Image {
77+ // TODO Use Icon here and use root.foregroundColor as keyColor
7578 id: backImage
7679 anchors {
7780 verticalCenter: parent.verticalCenter
@@ -91,7 +94,7 @@ Item {
9194 leftMargin: units.gu(0.5)
9295 }
9396 text: department ? department.parentLabel : ""
94− color: "gray" // TODO remove once we're a separate app
97+ color: root.foregroundColor
9598 }
9699
97100 Rectangle {
@@ -102,7 +105,7 @@ Item {
102105 leftMargin: units.gu(2)
103106 rightMargin: units.gu(2)
104107 }
105− color: "gray"
108+ color: "gray" // TODO Should this be root.foregroundColor ?
106109 opacity: 0.2
107110 height: units.dp(1)
108111 }
@@ -123,7 +126,7 @@ Item {
123126 }
124127 text: department ? (department.allLabel != "" ? department.allLabel : department.label) : ""
125128 font.bold: true
126− color: "gray" // TODO remove once we're a separate app
129+ color: root.foregroundColor
127130 }
128131
129132 Rectangle {
@@ -134,7 +137,7 @@ Item {
134137 leftMargin: units.gu(2)
135138 rightMargin: units.gu(2)
136139 }
137− color: "gray"
140+ color: "gray" // TODO Should this be root.foregroundColor ?
138141 opacity: 0.2
139142 height: units.dp(1)
140143 }
@@ -159,10 +162,11 @@ Item {
159162 leftMargin: units.gu(2)
160163 }
161164 text: label
162− color: "gray" // TODO remove once we're a separate app
165+ color: root.foregroundColor
163166 }
164167
165168 Image {
169+ // TODO Use Icon here and use root.foregroundColor as keyColor
166170 anchors {
167171 verticalCenter: parent.verticalCenter
168172 right: parent.right
@@ -183,7 +187,7 @@ Item {
183187 leftMargin: units.gu(2)
184188 rightMargin: units.gu(2)
185189 }
186− color: "gray"
190+ color: "gray" // TODO Should this be root.foregroundColor ?
187191 opacity: 0.1
188192 height: units.dp(1)
189193 visible: index != department.count - 1
qml/Dash/DashRenderer.qml+2
@@ -33,6 +33,8 @@ Item {
3333
3434 property real originY: 0
3535
36+ property color foregroundColor: "gray"
37+
3638 // The model to renderer
3739 property var model
3840
qml/Dash/GenericScopeView.qml+13−2
@@ -36,6 +36,7 @@ FocusScope {
3636 property ListModel searchHistory
3737 property bool enableHeightBehaviorOnNextCreation: false
3838 property var categoryView: categoryView
39+ property color foregroundColor: scope && scope.customizations["foreground-color"] || "grey"
3940
4041 signal backClicked()
4142
@@ -97,6 +98,13 @@ FocusScope {
9798 onHideDash: previewListView.open = false;
9899 }
99100
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+
100108 ScopeListView {
101109 id: categoryView
102110 objectName: "categoryListView"
@@ -159,6 +167,7 @@ FocusScope {
159167 item.model = Qt.binding(function() { return results })
160168 }
161169 item.objectName = Qt.binding(function() { return categoryId })
170+ item.foregroundColor = Qt.binding(function() { return scopeView.foregroundColor })
162171 if (item.expandable) {
163172 var shouldFilter = categoryId != categoryView.expandedCategoryId;
164173 item.setFilter(shouldFilter, false /*animate*/);
@@ -298,6 +307,7 @@ FocusScope {
298307 property var delegate: categoryView.item(delegateIndex)
299308 width: categoryView.width
300309 text: section
310+ textColor: foregroundColor
301311 image: {
302312 if (delegate && delegate.expandable)
303313 return delegate.filtered ? "graphics/header_handlearrow.png" : "graphics/header_handlearrow2.png"
@@ -319,8 +329,7 @@ FocusScope {
319329 showBackButton: scopeView.hasBackAction
320330 searchEntryEnabled: true
321331 searchInProgress: root.scope.searchInProgress
322− backgroundColor: scopeView.scope && scopeView.scope.customizations["background-color"] || "transparent"
323− foregroundColor: scopeView.scope && scopeView.scope.customizations["foreground-color"] || "grey"
332+ foregroundColor: scopeView.foregroundColor
324333 imageSource: scopeView.scope && scopeView.scope.customizations["page-header"] && scopeView.scope.customizations["page-header"]["logo"] || ""
325334
326335 bottomItem: DashDepartments {
@@ -329,6 +338,8 @@ FocusScope {
329338 anchors.right: parent.right
330339 windowHeight: scopeView.height
331340 windowWidth: scopeView.width
341+ foregroundColor: scopeView.foregroundColor
342+ // TODO Should we move the background color over the deparments combo too?
332343 }
333344
334345 onBackClicked: scopeView.backClicked()