on xenial help sign in
Use direct defaults instead of grouped in the default object
e55cd60Michał Sawicz
plugins/Dash/CardCreator.js+4−4
@@ -289,7 +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 var scopeStyle: Object({ foreground: "grey" }) \n\
292+ property var scopeStyle: null \n\
293 property int headerAlignment: Text.AlignLeft; \n\
293 property int headerAlignment: Text.AlignLeft; \n\
294 property int fixedHeaderHeight: -1; \n\
294 property int fixedHeaderHeight: -1; \n\
295 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
295 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
@@ -408,7 +408,7 @@ function cardString(template, components) {
408 mascotCode = kMascotImageCode.arg(anchors).arg(mascotImageVisible);
408 mascotCode = kMascotImageCode.arg(anchors).arg(mascotImageVisible);
409 }
409 }
410
410
411− var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : root.scopeStyle.foreground';
411+ var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : (root.scopeStyle ? root.scopeStyle.foreground : "grey")';
412
412
413 var titleSubtitleCode = "";
413 var titleSubtitleCode = "";
414 if (hasTitle) {
414 if (hasTitle) {
@@ -420,7 +420,7 @@ function cardString(template, components) {
420 } else if (hasBackground) {
420 } else if (hasBackground) {
421 color = summaryColorWithBackground;
421 color = summaryColorWithBackground;
422 } else {
422 } else {
423− color = 'root.scopeStyle.foreground';
423+ color = 'root.scopeStyle ? root.scopeStyle.foreground : "grey"';
424 }
424 }
425
425
426 var titleAnchors;
426 var titleAnchors;
@@ -496,7 +496,7 @@ function cardString(template, components) {
496 if (hasBackground) {
496 if (hasBackground) {
497 color = summaryColorWithBackground;
497 color = summaryColorWithBackground;
498 } else {
498 } else {
499− color = 'root.scopeStyle.foreground';
499+ color = 'root.scopeStyle ? root.scopeStyle.foreground : "grey"';
500 }
500 }
501
501
502 var summaryTopMargin = (hasMascot || hasSubtitle ? 'anchors.margins' : '0');
502 var summaryTopMargin = (hasMascot || hasSubtitle ? 'anchors.margins' : '0');
qml/Components/PageHeader.qml+5−8
@@ -38,10 +38,7 @@ Item {
38 // TODO We should use foreground for the icons
38 // TODO We should use foreground for the icons
39 // of the toolbar but unfortunately Action does not have
39 // of the toolbar but unfortunately Action does not have
40 // the keyColor property as Icon does :-/
40 // the keyColor property as Icon does :-/
41− property var scopeStyle: QtObject {
41+ property var scopeStyle: null
42− readonly property color foreground: "grey"
43− readonly property url headerLogo: ""
44− }
45
42
46 signal backClicked()
43 signal backClicked()
47
44
@@ -88,7 +85,7 @@ Item {
88 }
85 }
89
86
90 function refreshLogo() {
87 function refreshLogo() {
91− if (scopeStyle.headerLogo != "") {
88+ if (scopeStyle ? scopeStyle.headerLogo != "" : false) {
92 header.contents = imageComponent.createObject();
89 header.contents = imageComponent.createObject();
93 } else if (header.contents) {
90 } else if (header.contents) {
94 header.contents.destroy();
91 header.contents.destroy();
@@ -97,7 +94,7 @@ Item {
97 }
94 }
98
95
99 Connections {
96 Connections {
100− target: scopeStyle
97+ target: root.scopeStyle
101 onHeaderLogoChanged: root.refreshLogo()
98 onHeaderLogoChanged: root.refreshLogo()
102 }
99 }
103
100
@@ -226,7 +223,7 @@ Item {
226 height: headerContainer.height
223 height: headerContainer.height
227 contentHeight: height
224 contentHeight: height
228 separatorSource: ""
225 separatorSource: ""
229− textColor: root.scopeStyle.foreground
226+ textColor: root.scopeStyle ? root.scopeStyle.foreground : "grey"
230 property var styledItem: header
227 property var styledItem: header
231 property string title: root.title
228 property string title: root.title
232 property var config: PageHeadConfiguration {
229 property var config: PageHeadConfiguration {
@@ -262,7 +259,7 @@ Item {
262 Image {
259 Image {
263 objectName: "titleImage"
260 objectName: "titleImage"
264 anchors.fill: parent
261 anchors.fill: parent
265− source: root.scopeStyle.headerLogo
262+ source: root.scopeStyle ? root.scopeStyle.headerLogo : ""
266 fillMode: Image.PreserveAspectFit
263 fillMode: Image.PreserveAspectFit
267 horizontalAlignment: Image.AlignLeft
264 horizontalAlignment: Image.AlignLeft
268 sourceSize.height: height
265 sourceSize.height: height
qml/Dash/DashDepartments.qml+3−3
@@ -29,7 +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 var scopeStyle: { foreground: "grey" }
32+ property var scopeStyle: null
33
33
34 // Are we drilling down the tree or up?
34 // Are we drilling down the tree or up?
35 property bool isGoingBack: false
35 property bool isGoingBack: false
@@ -79,7 +79,7 @@ AbstractButton {
79 anchors.margins: units.gu(2)
79 anchors.margins: units.gu(2)
80 verticalAlignment: Text.AlignVCenter
80 verticalAlignment: Text.AlignVCenter
81 text: root.currentDepartment ? root.currentDepartment.label : ""
81 text: root.currentDepartment ? root.currentDepartment.label : ""
82− color: root.scopeStyle.foreground
82+ color: root.scopeStyle ? root.scopeStyle.foreground : "grey"
83 }
83 }
84
84
85 Icon {
85 Icon {
@@ -89,7 +89,7 @@ AbstractButton {
89 name: showList ? "up" : "down"
89 name: showList ? "up" : "down"
90 height: units.gu(2)
90 height: units.gu(2)
91 width: height
91 width: height
92− color: root.scopeStyle.foreground
92+ color: root.scopeStyle ? root.scopeStyle.foreground : "grey"
93 }
93 }
94
94
95 // departmentListView is outside root
95 // departmentListView is outside root
qml/Dash/DashDepartmentsList.qml+11−10
@@ -21,16 +21,17 @@ 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 var scopeStyle: Object({ foreground: "grey", background: "transparent" })
24+ property var scopeStyle: null
25 signal enterDepartment(var newDepartmentId, bool hasChildren)
25 signal enterDepartment(var newDepartmentId, bool hasChildren)
26 signal goBackToParentClicked()
26 signal goBackToParentClicked()
27 signal allDepartmentClicked()
27 signal allDepartmentClicked()
28
28
29 readonly property int itemHeight: units.gu(5)
29 readonly property int itemHeight: units.gu(5)
30+ readonly property color foregroundColor: root.scopeStyle ? root.scopeStyle.foreground : "grey"
30 implicitHeight: flickable.contentHeight
31 implicitHeight: flickable.contentHeight
31
32
32 Rectangle {
33 Rectangle {
33− color: Qt.colorEqual(root.scopeStyle.background, "transparent") ? "white" : root.scopeStyle.background
34+ color: !root.scopeStyle || Qt.colorEqual(root.scopeStyle.background, "transparent") ? "white" : root.scopeStyle.background
34 anchors.fill: parent
35 anchors.fill: parent
35 }
36 }
36
37
@@ -82,7 +83,7 @@ Item {
82 name: "back"
83 name: "back"
83 height: units.gu(2)
84 height: units.gu(2)
84 width: height
85 width: height
85− color: root.scopeStyle.foreground
86+ color: root.foregroundColor
86 }
87 }
87
88
88 Label {
89 Label {
@@ -92,7 +93,7 @@ Item {
92 leftMargin: units.gu(0.5)
93 leftMargin: units.gu(0.5)
93 }
94 }
94 text: department ? department.parentLabel : ""
95 text: department ? department.parentLabel : ""
95− color: root.scopeStyle.foreground
96+ color: root.foregroundColor
96 }
97 }
97
98
98 Rectangle {
99 Rectangle {
@@ -103,7 +104,7 @@ Item {
103 leftMargin: units.gu(2)
104 leftMargin: units.gu(2)
104 rightMargin: units.gu(2)
105 rightMargin: units.gu(2)
105 }
106 }
106− color: root.scopeStyle.foreground
107+ color: root.foregroundColor
107 opacity: 0.2
108 opacity: 0.2
108 height: units.dp(1)
109 height: units.dp(1)
109 }
110 }
@@ -124,7 +125,7 @@ Item {
124 }
125 }
125 text: department ? (department.allLabel != "" ? department.allLabel : department.label) : ""
126 text: department ? (department.allLabel != "" ? department.allLabel : department.label) : ""
126 font.bold: true
127 font.bold: true
127− color: root.scopeStyle.foreground
128+ color: root.foregroundColor
128 }
129 }
129
130
130 Rectangle {
131 Rectangle {
@@ -135,7 +136,7 @@ Item {
135 leftMargin: units.gu(2)
136 leftMargin: units.gu(2)
136 rightMargin: units.gu(2)
137 rightMargin: units.gu(2)
137 }
138 }
138− color: root.scopeStyle.foreground
139+ color: root.foregroundColor
139 opacity: 0.2
140 opacity: 0.2
140 height: units.dp(1)
141 height: units.dp(1)
141 }
142 }
@@ -160,7 +161,7 @@ Item {
160 leftMargin: units.gu(2)
161 leftMargin: units.gu(2)
161 }
162 }
162 text: label
163 text: label
163− color: root.scopeStyle.foreground
164+ color: root.foregroundColor
164 }
165 }
165
166
166 Icon {
167 Icon {
@@ -172,7 +173,7 @@ Item {
172 height: units.gu(2)
173 height: units.gu(2)
173 width: height
174 width: height
174 name: hasChildren ? "go-next" : "tick"
175 name: hasChildren ? "go-next" : "tick"
175− color: root.scopeStyle.foreground
176+ color: root.foregroundColor
176 visible: hasChildren || isActive
177 visible: hasChildren || isActive
177 }
178 }
178
179
@@ -184,7 +185,7 @@ Item {
184 leftMargin: units.gu(2)
185 leftMargin: units.gu(2)
185 rightMargin: units.gu(2)
186 rightMargin: units.gu(2)
186 }
187 }
187− color: root.scopeStyle.foreground
188+ color: root.foregroundColor
188 opacity: 0.1
189 opacity: 0.1
189 height: units.dp(1)
190 height: units.dp(1)
190 visible: index != department.count - 1
191 visible: index != department.count - 1
qml/Dash/GenericScopeView.qml+2−2
@@ -105,7 +105,7 @@ FocusScope {
105
105
106 Rectangle {
106 Rectangle {
107 anchors.fill: parent
107 anchors.fill: parent
108− color: scopeView.scopeStyle.background
108+ color: scopeView.scopeStyle ? scopeView.scopeStyle.background : "transparent"
109 visible: color != "transparent"
109 visible: color != "transparent"
110 }
110 }
111
111
@@ -316,7 +316,7 @@ FocusScope {
316 property var delegate: categoryView.item(delegateIndex)
316 property var delegate: categoryView.item(delegateIndex)
317 width: categoryView.width
317 width: categoryView.width
318 text: section
318 text: section
319− textColor: scopeStyle.foreground
319+ textColor: scopeStyle ? scopeStyle.foreground : "grey"
320 image: {
320 image: {
321 if (delegate && delegate.expandable)
321 if (delegate && delegate.expandable)
322 return delegate.filtered ? "graphics/header_handlearrow.png" : "graphics/header_handlearrow2.png"
322 return delegate.filtered ? "graphics/header_handlearrow.png" : "graphics/header_handlearrow2.png"
qml/Dash/Previews/PreviewAudioPlayback.qml+3−3
@@ -139,7 +139,7 @@ PreviewWidget {
139 objectName: "trackTitleLabel"
139 objectName: "trackTitleLabel"
140 anchors { top: parent.top; left: parent.left; right: parent.right }
140 anchors { top: parent.top; left: parent.left; right: parent.right }
141 opacity: 0.9
141 opacity: 0.9
142− color: scopeStyle.foreground
142+ color: scopeStyle ? scopeStyle.foreground : "grey"
143 fontSize: "small"
143 fontSize: "small"
144 horizontalAlignment: Text.AlignLeft
144 horizontalAlignment: Text.AlignLeft
145 text: modelData["title"]
145 text: modelData["title"]
@@ -152,7 +152,7 @@ PreviewWidget {
152 anchors { top: trackTitleLabel.bottom; left: parent.left; right: parent.right }
152 anchors { top: trackTitleLabel.bottom; left: parent.left; right: parent.right }
153 visible: text !== ""
153 visible: text !== ""
154 opacity: 0.9
154 opacity: 0.9
155− color: scopeStyle.foreground
155+ color: scopeStyle ? scopeStyle.foreground : "grey"
156 font.weight: Font.Light
156 font.weight: Font.Light
157 fontSize: "small"
157 fontSize: "small"
158 horizontalAlignment: Text.AlignLeft
158 horizontalAlignment: Text.AlignLeft
@@ -193,7 +193,7 @@ PreviewWidget {
193 anchors.verticalCenter: parent.verticalCenter
193 anchors.verticalCenter: parent.verticalCenter
194 width: parent.column3Width
194 width: parent.column3Width
195 opacity: 0.9
195 opacity: 0.9
196− color: scopeStyle.foreground
196+ color: scopeStyle ? scopeStyle.foreground : "grey"
197 fontSize: "small"
197 fontSize: "small"
198 horizontalAlignment: Text.AlignRight
198 horizontalAlignment: Text.AlignRight
199 text: audio.lengthToString(modelData["length"])
199 text: audio.lengthToString(modelData["length"])
qml/Dash/Previews/PreviewRatingDisplay.qml+2−2
@@ -71,7 +71,7 @@ PreviewWidget {
71 id: authorLabel
71 id: authorLabel
72 objectName: "authorLabel"
72 objectName: "authorLabel"
73 anchors { left: parent.left; right: parent.right }
73 anchors { left: parent.left; right: parent.right }
74− color: root.scopeStyle.foreground
74+ color: scopeStyle ? scopeStyle.foreground : "grey"
75 opacity: .8
75 opacity: .8
76 text: modelData["author"] || ""
76 text: modelData["author"] || ""
77 visible: text !== ""
77 visible: text !== ""
@@ -82,7 +82,7 @@ PreviewWidget {
82 id: reviewLabel
82 id: reviewLabel
83 objectName: "reviewLabel"
83 objectName: "reviewLabel"
84 anchors { left: parent.left; right: parent.right }
84 anchors { left: parent.left; right: parent.right }
85− color: root.scopeStyle.foreground
85+ color: scopeStyle ? scopeStyle.foreground : "grey"
86 opacity: .8
86 opacity: .8
87 text: modelData["review"] || ""
87 text: modelData["review"] || ""
88 visible: text !== ""
88 visible: text !== ""
qml/Dash/Previews/PreviewRatingInput.qml+2−2
@@ -76,7 +76,7 @@ PreviewWidget {
76 verticalCenter: parent.verticalCenter
76 verticalCenter: parent.verticalCenter
77 left: parent.left
77 left: parent.left
78 }
78 }
79− color: root.scopeStyle.foreground
79+ color: root.scopeStyle ? root.scopeStyle.foreground : "grey"
80 opacity: .8
80 opacity: .8
81 text: widgetData["rating-label"] || i18n.tr("Rate this")
81 text: widgetData["rating-label"] || i18n.tr("Rate this")
82 }
82 }
@@ -121,7 +121,7 @@ PreviewWidget {
121 left: parent.left
121 left: parent.left
122 right: parent.right
122 right: parent.right
123 }
123 }
124− color: root.scopeStyle.foreground
124+ color: root.scopeStyle ? root.scopeStyle.foreground : "grey"
125 opacity: .8
125 opacity: .8
126 text: widgetData["review-label"] || i18n.tr("Add a review")
126 text: widgetData["review-label"] || i18n.tr("Add a review")
127 }
127 }
qml/Dash/Previews/PreviewTextSummary.qml+2−2
@@ -39,7 +39,7 @@ PreviewWidget {
39 }
39 }
40 height: visible ? implicitHeight : 0
40 height: visible ? implicitHeight : 0
41 fontSize: "large"
41 fontSize: "large"
42− color: root.scopeStyle.foreground
42+ color: root.scopeStyle ? root.scopeStyle.foreground : "grey"
43 visible: text !== ""
43 visible: text !== ""
44 opacity: .8
44 opacity: .8
45 text: widgetData["title"] || ""
45 text: widgetData["title"] || ""
@@ -61,7 +61,7 @@ PreviewWidget {
61 clip: true
61 clip: true
62 fontSize: "small"
62 fontSize: "small"
63 lineHeight: 1.2
63 lineHeight: 1.2
64− color: root.scopeStyle.foreground
64+ color: root.scopeStyle ? root.scopeStyle.foreground : "grey"
65 opacity: .8
65 opacity: .8
66 text: widgetData["text"]
66 text: widgetData["text"]
67 wrapMode: Text.Wrap
67 wrapMode: Text.Wrap
qml/Dash/Previews/PreviewWidget.qml+1−1
@@ -29,7 +29,7 @@ Item {
29 property var widgetData
29 property var widgetData
30
30
31 //! The ScopeStyle component.
31 //! The ScopeStyle component.
32− property var scopeStyle: { foreground: "grey" }
32+ property var scopeStyle: null
33
33
34 /*! \brief This signal should be emitted when a preview action was triggered.
34 /*! \brief This signal should be emitted when a preview action was triggered.
35 *
35 *