on xenial help sign in
s/StyleTool/ScopeStyle/g
5dd8bb2Michał 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 styleTool: Object({ foreground: "grey" }) \n\
292+ property var scopeStyle: Object({ foreground: "grey" }) \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.styleTool.foreground';
411+ var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : root.scopeStyle.foreground';
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.styleTool.foreground';
423+ color = 'root.scopeStyle.foreground';
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.styleTool.foreground';
499+ color = 'root.scopeStyle.foreground';
500 }
500 }
501
501
502 var summaryTopMargin = (hasMascot || hasSubtitle ? 'anchors.margins' : '0');
502 var summaryTopMargin = (hasMascot || hasSubtitle ? 'anchors.margins' : '0');
plugins/Dash/StyleTool.qml → plugins/Dash/ScopeStyle.qmlrenamed

The content is the same.

plugins/Dash/qmldir+1−1
@@ -2,4 +2,4 @@ module Dash
2plugin Dash-qml
2plugin Dash-qml
3typeinfo Dash.qmltypes
3typeinfo Dash.qmltypes
4singleton CardCreatorCache 0.1 CardCreatorCache.qml
4singleton CardCreatorCache 0.1 CardCreatorCache.qml
5−StyleTool 0.1 StyleTool.qml
5+ScopeStyle 0.1 ScopeStyle.qml
qml/Components/PageHeader.qml+6−6
@@ -38,14 +38,14 @@ 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 styleTool: QtObject {
41+ property var scopeStyle: QtObject {
42 readonly property color foreground: "grey"
42 readonly property color foreground: "grey"
43 readonly property url headerLogo: ""
43 readonly property url headerLogo: ""
44 }
44 }
45
45
46 signal backClicked()
46 signal backClicked()
47
47
48− onStyleToolChanged: refreshLogo()
48+ onScopeStyleChanged: refreshLogo()
49
49
50 function triggerSearch() {
50 function triggerSearch() {
51 if (searchEntryEnabled) {
51 if (searchEntryEnabled) {
@@ -88,7 +88,7 @@ Item {
88 }
88 }
89
89
90 function refreshLogo() {
90 function refreshLogo() {
91− if (styleTool.headerLogo != "") {
91+ if (scopeStyle.headerLogo != "") {
92 header.contents = imageComponent.createObject();
92 header.contents = imageComponent.createObject();
93 } else if (header.contents) {
93 } else if (header.contents) {
94 header.contents.destroy();
94 header.contents.destroy();
@@ -97,7 +97,7 @@ Item {
97 }
97 }
98
98
99 Connections {
99 Connections {
100− target: styleTool
100+ target: scopeStyle
101 onHeaderLogoChanged: root.refreshLogo()
101 onHeaderLogoChanged: root.refreshLogo()
102 }
102 }
103
103
@@ -226,7 +226,7 @@ Item {
226 height: headerContainer.height
226 height: headerContainer.height
227 contentHeight: height
227 contentHeight: height
228 separatorSource: ""
228 separatorSource: ""
229− textColor: root.styleTool.foreground
229+ textColor: root.scopeStyle.foreground
230 property var styledItem: header
230 property var styledItem: header
231 property string title: root.title
231 property string title: root.title
232 property var config: PageHeadConfiguration {
232 property var config: PageHeadConfiguration {
@@ -262,7 +262,7 @@ Item {
262 Image {
262 Image {
263 objectName: "titleImage"
263 objectName: "titleImage"
264 anchors.fill: parent
264 anchors.fill: parent
265− source: root.styleTool.headerLogo
265+ source: root.scopeStyle.headerLogo
266 fillMode: Image.PreserveAspectFit
266 fillMode: Image.PreserveAspectFit
267 horizontalAlignment: Image.AlignLeft
267 horizontalAlignment: Image.AlignLeft
268 sourceSize.height: height
268 sourceSize.height: height
qml/Dash/CardCarousel.qml+1−1
@@ -64,7 +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.styleTool = cardCarousel.styleTool;
67+ item.scopeStyle = cardCarousel.scopeStyle;
68 }
68 }
69
69
70 BorderImage {
70 BorderImage {
qml/Dash/CardFilterGrid.qml+1−1
@@ -58,7 +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.styleTool = genericFilterGrid.styleTool;
61+ item.scopeStyle = genericFilterGrid.scopeStyle;
62 }
62 }
63 Connections {
63 Connections {
64 target: loader.item
64 target: loader.item
qml/Dash/CardVerticalJournal.qml+1−1
@@ -75,7 +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.styleTool = root.styleTool;
78+ item.scopeStyle = root.scopeStyle;
79 }
79 }
80 Connections {
80 Connections {
81 target: loader.item
81 target: loader.item
qml/Dash/DashDepartments.qml+4−4
@@ -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 styleTool: { foreground: "grey" }
32+ property var scopeStyle: { foreground: "grey" }
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.styleTool.foreground
82+ color: root.scopeStyle.foreground
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.styleTool.foreground
92+ color: root.scopeStyle.foreground
93 }
93 }
94
94
95 // departmentListView is outside root
95 // departmentListView is outside root
@@ -124,7 +124,7 @@ AbstractButton {
124 objectName: "department" + index
124 objectName: "department" + index
125 visible: height != 0
125 visible: height != 0
126 width: departmentListView.width
126 width: departmentListView.width
127− styleTool: root.styleTool
127+ scopeStyle: root.scopeStyle
128 property real desiredHeight: {
128 property real desiredHeight: {
129 if (root.showList) {
129 if (root.showList) {
130 if (department && department.loaded && x == departmentListView.contentX)
130 if (department && department.loaded && x == departmentListView.contentX)
qml/Dash/DashDepartmentsList.qml+10−10
@@ -21,7 +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 var styleTool: Object({ foreground: "grey", background: "transparent" })
24+ property var scopeStyle: Object({ foreground: "grey", background: "transparent" })
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()
@@ -30,7 +30,7 @@ Item {
30 implicitHeight: flickable.contentHeight
30 implicitHeight: flickable.contentHeight
31
31
32 Rectangle {
32 Rectangle {
33− color: Qt.colorEqual(root.styleTool.background, "transparent") ? "white" : root.styleTool.background
33+ color: Qt.colorEqual(root.scopeStyle.background, "transparent") ? "white" : root.scopeStyle.background
34 anchors.fill: parent
34 anchors.fill: parent
35 }
35 }
36
36
@@ -82,7 +82,7 @@ Item {
82 name: "back"
82 name: "back"
83 height: units.gu(2)
83 height: units.gu(2)
84 width: height
84 width: height
85− color: root.styleTool.foreground
85+ color: root.scopeStyle.foreground
86 }
86 }
87
87
88 Label {
88 Label {
@@ -92,7 +92,7 @@ Item {
92 leftMargin: units.gu(0.5)
92 leftMargin: units.gu(0.5)
93 }
93 }
94 text: department ? department.parentLabel : ""
94 text: department ? department.parentLabel : ""
95− color: root.styleTool.foreground
95+ color: root.scopeStyle.foreground
96 }
96 }
97
97
98 Rectangle {
98 Rectangle {
@@ -103,7 +103,7 @@ Item {
103 leftMargin: units.gu(2)
103 leftMargin: units.gu(2)
104 rightMargin: units.gu(2)
104 rightMargin: units.gu(2)
105 }
105 }
106− color: root.styleTool.foreground
106+ color: root.scopeStyle.foreground
107 opacity: 0.2
107 opacity: 0.2
108 height: units.dp(1)
108 height: units.dp(1)
109 }
109 }
@@ -124,7 +124,7 @@ Item {
124 }
124 }
125 text: department ? (department.allLabel != "" ? department.allLabel : department.label) : ""
125 text: department ? (department.allLabel != "" ? department.allLabel : department.label) : ""
126 font.bold: true
126 font.bold: true
127− color: root.styleTool.foreground
127+ color: root.scopeStyle.foreground
128 }
128 }
129
129
130 Rectangle {
130 Rectangle {
@@ -135,7 +135,7 @@ Item {
135 leftMargin: units.gu(2)
135 leftMargin: units.gu(2)
136 rightMargin: units.gu(2)
136 rightMargin: units.gu(2)
137 }
137 }
138− color: root.styleTool.foreground
138+ color: root.scopeStyle.foreground
139 opacity: 0.2
139 opacity: 0.2
140 height: units.dp(1)
140 height: units.dp(1)
141 }
141 }
@@ -160,7 +160,7 @@ Item {
160 leftMargin: units.gu(2)
160 leftMargin: units.gu(2)
161 }
161 }
162 text: label
162 text: label
163− color: root.styleTool.foreground
163+ color: root.scopeStyle.foreground
164 }
164 }
165
165
166 Icon {
166 Icon {
@@ -172,7 +172,7 @@ Item {
172 height: units.gu(2)
172 height: units.gu(2)
173 width: height
173 width: height
174 name: hasChildren ? "go-next" : "tick"
174 name: hasChildren ? "go-next" : "tick"
175− color: root.styleTool.foreground
175+ color: root.scopeStyle.foreground
176 visible: hasChildren || isActive
176 visible: hasChildren || isActive
177 }
177 }
178
178
@@ -184,7 +184,7 @@ Item {
184 leftMargin: units.gu(2)
184 leftMargin: units.gu(2)
185 rightMargin: units.gu(2)
185 rightMargin: units.gu(2)
186 }
186 }
187− color: root.styleTool.foreground
187+ color: root.scopeStyle.foreground
188 opacity: 0.1
188 opacity: 0.1
189 height: units.dp(1)
189 height: units.dp(1)
190 visible: index != department.count - 1
190 visible: index != department.count - 1
qml/Dash/DashRenderer.qml+2−2
@@ -39,8 +39,8 @@ Item {
39 /// CardTool component.
39 /// CardTool component.
40 property var cardTool: null
40 property var cardTool: null
41
41
42− /// StyleTool component.
42+ /// ScopeStyle component.
43− property var styleTool: null
43+ property var scopeStyle: null
44
44
45 /// Emitted when the user clicked on an item
45 /// Emitted when the user clicked on an item
46 /// @param index is the index of the clicked item
46 /// @param index is the index of the clicked item
qml/Dash/GenericScopeView.qml+7−7
@@ -35,7 +35,7 @@ FocusScope {
35 property bool enableHeightBehaviorOnNextCreation: false
35 property bool enableHeightBehaviorOnNextCreation: false
36 property var categoryView: categoryView
36 property var categoryView: categoryView
37
37
38− property var styleTool: StyleTool {
38+ property var scopeStyle: ScopeStyle {
39 style: scope ? scope.customizations : {}
39 style: scope ? scope.customizations : {}
40 }
40 }
41
41
@@ -105,7 +105,7 @@ FocusScope {
105
105
106 Rectangle {
106 Rectangle {
107 anchors.fill: parent
107 anchors.fill: parent
108− color: scopeView.styleTool.background
108+ color: scopeView.scopeStyle.background
109 visible: color != "transparent"
109 visible: color != "transparent"
110 }
110 }
111
111
@@ -176,7 +176,7 @@ FocusScope {
176 item.model = Qt.binding(function() { return results })
176 item.model = Qt.binding(function() { return results })
177 }
177 }
178 item.objectName = Qt.binding(function() { return categoryId })
178 item.objectName = Qt.binding(function() { return categoryId })
179− item.styleTool = scopeView.styleTool;
179+ item.scopeStyle = scopeView.scopeStyle;
180 if (item.expandable) {
180 if (item.expandable) {
181 var shouldFilter = categoryId != categoryView.expandedCategoryId;
181 var shouldFilter = categoryId != categoryView.expandedCategoryId;
182 item.setFilter(shouldFilter, false /*animate*/);
182 item.setFilter(shouldFilter, false /*animate*/);
@@ -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: styleTool.foreground
319+ textColor: scopeStyle.foreground
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"
@@ -337,7 +337,7 @@ FocusScope {
337 showBackButton: scopeView.hasBackAction
337 showBackButton: scopeView.hasBackAction
338 searchEntryEnabled: true
338 searchEntryEnabled: true
339 searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false
339 searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false
340− styleTool: scopeView.styleTool
340+ scopeStyle: scopeView.scopeStyle
341
341
342 bottomItem: DashDepartments {
342 bottomItem: DashDepartments {
343 scope: scopeView.scope
343 scope: scopeView.scope
@@ -345,7 +345,7 @@ FocusScope {
345 anchors.right: parent.right
345 anchors.right: parent.right
346 windowHeight: scopeView.height
346 windowHeight: scopeView.height
347 windowWidth: scopeView.width
347 windowWidth: scopeView.width
348− styleTool: scopeView.styleTool
348+ scopeStyle: scopeView.scopeStyle
349 }
349 }
350
350
351 onBackClicked: scopeView.backClicked()
351 onBackClicked: scopeView.backClicked()
@@ -357,7 +357,7 @@ FocusScope {
357 objectName: "previewListView"
357 objectName: "previewListView"
358 visible: x != width
358 visible: x != width
359 scope: scopeView.scope
359 scope: scopeView.scope
360− styleTool: scopeView.styleTool
360+ scopeStyle: scopeView.scopeStyle
361 width: parent.width
361 width: parent.width
362 height: parent.height
362 height: parent.height
363 anchors.left: categoryView.right
363 anchors.left: categoryView.right
qml/Dash/PreviewListView.qml+3−3
@@ -24,7 +24,7 @@ Item {
24 id: root
24 id: root
25
25
26 property var scope: null
26 property var scope: null
27− property var styleTool: null
27+ property var scopeStyle: null
28
28
29 property alias open: previewListView.open
29 property alias open: previewListView.open
30 property alias model: previewListView.model
30 property alias model: previewListView.model
@@ -39,7 +39,7 @@ Item {
39 title: scope ? scope.name : ""
39 title: scope ? scope.name : ""
40 showBackButton: true
40 showBackButton: true
41 searchEntryEnabled: false
41 searchEntryEnabled: false
42− styleTool: root.styleTool
42+ scopeStyle: root.scopeStyle
43
43
44 onBackClicked: root.open = false
44 onBackClicked: root.open = false
45 }
45 }
@@ -103,7 +103,7 @@ Item {
103 var previewStack = root.scope.preview(result);
103 var previewStack = root.scope.preview(result);
104 return previewStack.getPreviewModel(0);
104 return previewStack.getPreviewModel(0);
105 }
105 }
106− styleTool: root.styleTool
106+ scopeStyle: root.scopeStyle
107 }
107 }
108
108
109 MouseArea {
109 MouseArea {
qml/Dash/Previews/Preview.qml+2−2
@@ -36,8 +36,8 @@ Item {
36 //! \brief Should be set to true if this preview is currently displayed.
36 //! \brief Should be set to true if this preview is currently displayed.
37 property bool isCurrent: false
37 property bool isCurrent: false
38
38
39− //! \brief The StyleTool component.
39+ //! \brief The ScopeStyle component.
40− property var styleTool: null
40+ property var scopeStyle: null
41
41
42 clip: true
42 clip: true
43
43
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: styleTool.foreground
142+ color: scopeStyle.foreground
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: styleTool.foreground
155+ color: scopeStyle.foreground
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: styleTool.foreground
196+ color: scopeStyle.foreground
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/PreviewHeader.qml+1−1
@@ -35,7 +35,7 @@ PreviewWidget {
35 readonly property url mascot: root.widgetData["mascot"] || ""
35 readonly property url mascot: root.widgetData["mascot"] || ""
36 readonly property string title: root.widgetData["title"] || ""
36 readonly property string title: root.widgetData["title"] || ""
37 readonly property string subtitle: root.widgetData["subtitle"] || ""
37 readonly property string subtitle: root.widgetData["subtitle"] || ""
38− readonly property color fontColor: root.styleTool.foreground
38+ readonly property color fontColor: root.scopeStyle.foreground
39
39
40 implicitHeight: row.height + row.margins * 2
40 implicitHeight: row.height + row.margins * 2
41 width: parent.width
41 width: parent.width
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.styleTool.foreground
74+ color: root.scopeStyle.foreground
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.styleTool.foreground
85+ color: root.scopeStyle.foreground
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.styleTool.foreground
79+ color: root.scopeStyle.foreground
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.styleTool.foreground
124+ color: root.scopeStyle.foreground
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.styleTool.foreground
42+ color: root.scopeStyle.foreground
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.styleTool.foreground
64+ color: root.scopeStyle.foreground
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+2−2
@@ -28,8 +28,8 @@ Item {
28 //! Variable used to contain widget's data
28 //! Variable used to contain widget's data
29 property var widgetData
29 property var widgetData
30
30
31− //! The StyleTool component.
31+ //! The ScopeStyle component.
32− property var styleTool: { foreground: "grey" }
32+ property var scopeStyle: { foreground: "grey" }
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 *
qml/Dash/Previews/PreviewWidgetFactory.qml+3−3
@@ -31,8 +31,8 @@ Loader {
31 //! Widget data, forwarded to the widget as is.
31 //! Widget data, forwarded to the widget as is.
32 property var widgetData: null
32 property var widgetData: null
33
33
34− //! The StyleTool component.
34+ //! The ScopeStyle component.
35− property var styleTool: null
35+ property var scopeStyle: null
36
36
37 //! Set to true if the parent preview is displayed.
37 //! Set to true if the parent preview is displayed.
38 property bool isCurrentPreview: false
38 property bool isCurrentPreview: false
@@ -65,7 +65,7 @@ Loader {
65 item.widgetId = Qt.binding(function() { return root.widgetId } )
65 item.widgetId = Qt.binding(function() { return root.widgetId } )
66 item.widgetData = Qt.binding(function() { return root.widgetData } )
66 item.widgetData = Qt.binding(function() { return root.widgetData } )
67 item.isCurrentPreview = Qt.binding(function() { return root.isCurrentPreview } )
67 item.isCurrentPreview = Qt.binding(function() { return root.isCurrentPreview } )
68− if (item.hasOwnProperty("styleTool")) item.styleTool = root.styleTool;
68+ if (item.hasOwnProperty("scopeStyle")) item.scopeStyle = root.scopeStyle;
69 }
69 }
70
70
71 Connections {
71 Connections {
tests/plugins/Dash/CMakeLists.txt+1−1
@@ -75,7 +75,7 @@ add_binary_qml_test(CardCreator "" "Dash-qml")
75
75
76# qml unit test
76# qml unit test
77set(qmltest_DEFAULT_TARGETS qmltests)
77set(qmltest_DEFAULT_TARGETS qmltests)
78−add_qml_test(. StyleTool IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
78+add_qml_test(. ScopeStyle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
79
79
80# plain qml test
80# plain qml test
81set(qmltest_DEFAULT_TARGETS qmluitests)
81set(qmltest_DEFAULT_TARGETS qmluitests)
tests/plugins/Dash/tst_StyleTool.qml → tests/plugins/Dash/tst_ScopeStyle.qmlrenamed+2−2
@@ -23,13 +23,13 @@ Rectangle {
23 width: units.gu(40)
23 width: units.gu(40)
24 height: units.gu(71)
24 height: units.gu(71)
25
25
26− StyleTool {
26+ ScopeStyle {
27 id: tool
27 id: tool
28 }
28 }
29
29
30 TestCase {
30 TestCase {
31 id: testCase
31 id: testCase
32− name: "StyleTool"
32+ name: "ScopeStyle"
33 when: windowShown
33 when: windowShown
34
34
35 property color color
35 property color color
tests/qmltests/Components/tst_PageHeader.qml+1−1
@@ -213,7 +213,7 @@ Item {
213
213
214 searchEntryEnabled: true
214 searchEntryEnabled: true
215 title: "%^$%^%^&%^&%^$%GHR%"
215 title: "%^$%^%^&%^&%^$%GHR%"
216− styleTool: QtObject {
216+ scopeStyle: QtObject {
217 readonly property color foreground: "grey"
217 readonly property color foreground: "grey"
218 readonly property url headerLogo: showImageCheckBox.checked ? pageHeader.titleImageSource : ""
218 readonly property url headerLogo: showImageCheckBox.checked ? pageHeader.titleImageSource : ""
219 }
219 }