on xenial help sign in
s/StyleTool/ScopeStyle/g
commit5dd8bb2cf53e89bd03e210819b52261da6a36b15 authorMichał Sawicz <michal.sawicz@canonical.com> dateTue 8 Jul 2014, 10:30 (12 years ago) parentb90aabd
23 files changed+61−61
plugins/Dash/CardCreator.js+4−4 plugins/Dash/StyleTool.qml → plugins/Dash/ScopeStyle.qml plugins/Dash/qmldir+1−1 qml/Components/PageHeader.qml+6−6 qml/Dash/CardCarousel.qml+1−1 qml/Dash/CardFilterGrid.qml+1−1 qml/Dash/CardVerticalJournal.qml+1−1 qml/Dash/DashDepartments.qml+4−4 qml/Dash/DashDepartmentsList.qml+10−10 qml/Dash/DashRenderer.qml+2−2 qml/Dash/GenericScopeView.qml+7−7 qml/Dash/PreviewListView.qml+3−3 qml/Dash/Previews/Preview.qml+2−2 qml/Dash/Previews/PreviewAudioPlayback.qml+3−3 qml/Dash/Previews/PreviewHeader.qml+1−1 qml/Dash/Previews/PreviewRatingDisplay.qml+2−2 qml/Dash/Previews/PreviewRatingInput.qml+2−2 qml/Dash/Previews/PreviewTextSummary.qml+2−2 qml/Dash/Previews/PreviewWidget.qml+2−2 qml/Dash/Previews/PreviewWidgetFactory.qml+3−3 tests/plugins/Dash/CMakeLists.txt+1−1 tests/plugins/Dash/tst_StyleTool.qml → tests/plugins/Dash/tst_ScopeStyle.qml+2−2 tests/qmltests/Components/tst_PageHeader.qml+1−1
plugins/Dash/CardCreator.js+4−4
@@ -289,7 +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 var styleTool: Object({ foreground: "grey" }) \n\
292+ property var scopeStyle: Object({ foreground: "grey" }) \n\
293293 property int headerAlignment: Text.AlignLeft; \n\
294294 property int fixedHeaderHeight: -1; \n\
295295 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
@@ -408,7 +408,7 @@ function cardString(template, components) {
408408 mascotCode = kMascotImageCode.arg(anchors).arg(mascotImageVisible);
409409 }
410410
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';
412412
413413 var titleSubtitleCode = "";
414414 if (hasTitle) {
@@ -420,7 +420,7 @@ function cardString(template, components) {
420420 } else if (hasBackground) {
421421 color = summaryColorWithBackground;
422422 } else {
423− color = 'root.styleTool.foreground';
423+ color = 'root.scopeStyle.foreground';
424424 }
425425
426426 var titleAnchors;
@@ -496,7 +496,7 @@ function cardString(template, components) {
496496 if (hasBackground) {
497497 color = summaryColorWithBackground;
498498 } else {
499− color = 'root.styleTool.foreground';
499+ color = 'root.scopeStyle.foreground';
500500 }
501501
502502 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
22plugin Dash-qml
33typeinfo Dash.qmltypes
44singleton 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 {
3838 // TODO We should use foreground for the icons
3939 // of the toolbar but unfortunately Action does not have
4040 // the keyColor property as Icon does :-/
41− property var styleTool: QtObject {
41+ property var scopeStyle: QtObject {
4242 readonly property color foreground: "grey"
4343 readonly property url headerLogo: ""
4444 }
4545
4646 signal backClicked()
4747
48− onStyleToolChanged: refreshLogo()
48+ onScopeStyleChanged: refreshLogo()
4949
5050 function triggerSearch() {
5151 if (searchEntryEnabled) {
@@ -88,7 +88,7 @@ Item {
8888 }
8989
9090 function refreshLogo() {
91− if (styleTool.headerLogo != "") {
91+ if (scopeStyle.headerLogo != "") {
9292 header.contents = imageComponent.createObject();
9393 } else if (header.contents) {
9494 header.contents.destroy();
@@ -97,7 +97,7 @@ Item {
9797 }
9898
9999 Connections {
100− target: styleTool
100+ target: scopeStyle
101101 onHeaderLogoChanged: root.refreshLogo()
102102 }
103103
@@ -226,7 +226,7 @@ Item {
226226 height: headerContainer.height
227227 contentHeight: height
228228 separatorSource: ""
229− textColor: root.styleTool.foreground
229+ textColor: root.scopeStyle.foreground
230230 property var styledItem: header
231231 property string title: root.title
232232 property var config: PageHeadConfiguration {
@@ -262,7 +262,7 @@ Item {
262262 Image {
263263 objectName: "titleImage"
264264 anchors.fill: parent
265− source: root.styleTool.headerLogo
265+ source: root.scopeStyle.headerLogo
266266 fillMode: Image.PreserveAspectFit
267267 horizontalAlignment: Image.AlignLeft
268268 sourceSize.height: height
qml/Dash/CardCarousel.qml+1−1
@@ -64,7 +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.styleTool = cardCarousel.styleTool;
67+ item.scopeStyle = cardCarousel.scopeStyle;
6868 }
6969
7070 BorderImage {
qml/Dash/CardFilterGrid.qml+1−1
@@ -58,7 +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.styleTool = genericFilterGrid.styleTool;
61+ item.scopeStyle = genericFilterGrid.scopeStyle;
6262 }
6363 Connections {
6464 target: loader.item
qml/Dash/CardVerticalJournal.qml+1−1
@@ -75,7 +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.styleTool = root.styleTool;
78+ item.scopeStyle = root.scopeStyle;
7979 }
8080 Connections {
8181 target: loader.item
qml/Dash/DashDepartments.qml+4−4
@@ -29,7 +29,7 @@ AbstractButton {
2929
3030 property alias windowWidth: blackRect.width
3131 property alias windowHeight: blackRect.height
32− property var styleTool: { foreground: "grey" }
32+ property var scopeStyle: { foreground: "grey" }
3333
3434 // Are we drilling down the tree or up?
3535 property bool isGoingBack: false
@@ -79,7 +79,7 @@ AbstractButton {
7979 anchors.margins: units.gu(2)
8080 verticalAlignment: Text.AlignVCenter
8181 text: root.currentDepartment ? root.currentDepartment.label : ""
82− color: root.styleTool.foreground
82+ color: root.scopeStyle.foreground
8383 }
8484
8585 Icon {
@@ -89,7 +89,7 @@ AbstractButton {
8989 name: showList ? "up" : "down"
9090 height: units.gu(2)
9191 width: height
92− color: root.styleTool.foreground
92+ color: root.scopeStyle.foreground
9393 }
9494
9595 // departmentListView is outside root
@@ -124,7 +124,7 @@ AbstractButton {
124124 objectName: "department" + index
125125 visible: height != 0
126126 width: departmentListView.width
127− styleTool: root.styleTool
127+ scopeStyle: root.scopeStyle
128128 property real desiredHeight: {
129129 if (root.showList) {
130130 if (department && department.loaded && x == departmentListView.contentX)
qml/Dash/DashDepartmentsList.qml+10−10
@@ -21,7 +21,7 @@ Item {
2121 id: root
2222 property var department: null
2323 property var currentDepartment: null
24− property var styleTool: Object({ foreground: "grey", background: "transparent" })
24+ property var scopeStyle: Object({ foreground: "grey", background: "transparent" })
2525 signal enterDepartment(var newDepartmentId, bool hasChildren)
2626 signal goBackToParentClicked()
2727 signal allDepartmentClicked()
@@ -30,7 +30,7 @@ Item {
3030 implicitHeight: flickable.contentHeight
3131
3232 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
3434 anchors.fill: parent
3535 }
3636
@@ -82,7 +82,7 @@ Item {
8282 name: "back"
8383 height: units.gu(2)
8484 width: height
85− color: root.styleTool.foreground
85+ color: root.scopeStyle.foreground
8686 }
8787
8888 Label {
@@ -92,7 +92,7 @@ Item {
9292 leftMargin: units.gu(0.5)
9393 }
9494 text: department ? department.parentLabel : ""
95− color: root.styleTool.foreground
95+ color: root.scopeStyle.foreground
9696 }
9797
9898 Rectangle {
@@ -103,7 +103,7 @@ Item {
103103 leftMargin: units.gu(2)
104104 rightMargin: units.gu(2)
105105 }
106− color: root.styleTool.foreground
106+ color: root.scopeStyle.foreground
107107 opacity: 0.2
108108 height: units.dp(1)
109109 }
@@ -124,7 +124,7 @@ Item {
124124 }
125125 text: department ? (department.allLabel != "" ? department.allLabel : department.label) : ""
126126 font.bold: true
127− color: root.styleTool.foreground
127+ color: root.scopeStyle.foreground
128128 }
129129
130130 Rectangle {
@@ -135,7 +135,7 @@ Item {
135135 leftMargin: units.gu(2)
136136 rightMargin: units.gu(2)
137137 }
138− color: root.styleTool.foreground
138+ color: root.scopeStyle.foreground
139139 opacity: 0.2
140140 height: units.dp(1)
141141 }
@@ -160,7 +160,7 @@ Item {
160160 leftMargin: units.gu(2)
161161 }
162162 text: label
163− color: root.styleTool.foreground
163+ color: root.scopeStyle.foreground
164164 }
165165
166166 Icon {
@@ -172,7 +172,7 @@ Item {
172172 height: units.gu(2)
173173 width: height
174174 name: hasChildren ? "go-next" : "tick"
175− color: root.styleTool.foreground
175+ color: root.scopeStyle.foreground
176176 visible: hasChildren || isActive
177177 }
178178
@@ -184,7 +184,7 @@ Item {
184184 leftMargin: units.gu(2)
185185 rightMargin: units.gu(2)
186186 }
187− color: root.styleTool.foreground
187+ color: root.scopeStyle.foreground
188188 opacity: 0.1
189189 height: units.dp(1)
190190 visible: index != department.count - 1
qml/Dash/DashRenderer.qml+2−2
@@ -39,8 +39,8 @@ Item {
3939 /// CardTool component.
4040 property var cardTool: null
4141
42− /// StyleTool component.
43− property var styleTool: null
42+ /// ScopeStyle component.
43+ property var scopeStyle: null
4444
4545 /// Emitted when the user clicked on an item
4646 /// @param index is the index of the clicked item
qml/Dash/GenericScopeView.qml+7−7
@@ -35,7 +35,7 @@ FocusScope {
3535 property bool enableHeightBehaviorOnNextCreation: false
3636 property var categoryView: categoryView
3737
38− property var styleTool: StyleTool {
38+ property var scopeStyle: ScopeStyle {
3939 style: scope ? scope.customizations : {}
4040 }
4141
@@ -105,7 +105,7 @@ FocusScope {
105105
106106 Rectangle {
107107 anchors.fill: parent
108− color: scopeView.styleTool.background
108+ color: scopeView.scopeStyle.background
109109 visible: color != "transparent"
110110 }
111111
@@ -176,7 +176,7 @@ FocusScope {
176176 item.model = Qt.binding(function() { return results })
177177 }
178178 item.objectName = Qt.binding(function() { return categoryId })
179− item.styleTool = scopeView.styleTool;
179+ item.scopeStyle = scopeView.scopeStyle;
180180 if (item.expandable) {
181181 var shouldFilter = categoryId != categoryView.expandedCategoryId;
182182 item.setFilter(shouldFilter, false /*animate*/);
@@ -316,7 +316,7 @@ FocusScope {
316316 property var delegate: categoryView.item(delegateIndex)
317317 width: categoryView.width
318318 text: section
319− textColor: styleTool.foreground
319+ textColor: scopeStyle.foreground
320320 image: {
321321 if (delegate && delegate.expandable)
322322 return delegate.filtered ? "graphics/header_handlearrow.png" : "graphics/header_handlearrow2.png"
@@ -337,7 +337,7 @@ FocusScope {
337337 showBackButton: scopeView.hasBackAction
338338 searchEntryEnabled: true
339339 searchInProgress: scopeView.scope ? scopeView.scope.searchInProgress : false
340− styleTool: scopeView.styleTool
340+ scopeStyle: scopeView.scopeStyle
341341
342342 bottomItem: DashDepartments {
343343 scope: scopeView.scope
@@ -345,7 +345,7 @@ FocusScope {
345345 anchors.right: parent.right
346346 windowHeight: scopeView.height
347347 windowWidth: scopeView.width
348− styleTool: scopeView.styleTool
348+ scopeStyle: scopeView.scopeStyle
349349 }
350350
351351 onBackClicked: scopeView.backClicked()
@@ -357,7 +357,7 @@ FocusScope {
357357 objectName: "previewListView"
358358 visible: x != width
359359 scope: scopeView.scope
360− styleTool: scopeView.styleTool
360+ scopeStyle: scopeView.scopeStyle
361361 width: parent.width
362362 height: parent.height
363363 anchors.left: categoryView.right
qml/Dash/PreviewListView.qml+3−3
@@ -24,7 +24,7 @@ Item {
2424 id: root
2525
2626 property var scope: null
27− property var styleTool: null
27+ property var scopeStyle: null
2828
2929 property alias open: previewListView.open
3030 property alias model: previewListView.model
@@ -39,7 +39,7 @@ Item {
3939 title: scope ? scope.name : ""
4040 showBackButton: true
4141 searchEntryEnabled: false
42− styleTool: root.styleTool
42+ scopeStyle: root.scopeStyle
4343
4444 onBackClicked: root.open = false
4545 }
@@ -103,7 +103,7 @@ Item {
103103 var previewStack = root.scope.preview(result);
104104 return previewStack.getPreviewModel(0);
105105 }
106− styleTool: root.styleTool
106+ scopeStyle: root.scopeStyle
107107 }
108108
109109 MouseArea {
qml/Dash/Previews/Preview.qml+2−2
@@ -36,8 +36,8 @@ Item {
3636 //! \brief Should be set to true if this preview is currently displayed.
3737 property bool isCurrent: false
3838
39− //! \brief The StyleTool component.
40− property var styleTool: null
39+ //! \brief The ScopeStyle component.
40+ property var scopeStyle: null
4141
4242 clip: true
4343
qml/Dash/Previews/PreviewAudioPlayback.qml+3−3
@@ -139,7 +139,7 @@ PreviewWidget {
139139 objectName: "trackTitleLabel"
140140 anchors { top: parent.top; left: parent.left; right: parent.right }
141141 opacity: 0.9
142− color: styleTool.foreground
142+ color: scopeStyle.foreground
143143 fontSize: "small"
144144 horizontalAlignment: Text.AlignLeft
145145 text: modelData["title"]
@@ -152,7 +152,7 @@ PreviewWidget {
152152 anchors { top: trackTitleLabel.bottom; left: parent.left; right: parent.right }
153153 visible: text !== ""
154154 opacity: 0.9
155− color: styleTool.foreground
155+ color: scopeStyle.foreground
156156 font.weight: Font.Light
157157 fontSize: "small"
158158 horizontalAlignment: Text.AlignLeft
@@ -193,7 +193,7 @@ PreviewWidget {
193193 anchors.verticalCenter: parent.verticalCenter
194194 width: parent.column3Width
195195 opacity: 0.9
196− color: styleTool.foreground
196+ color: scopeStyle.foreground
197197 fontSize: "small"
198198 horizontalAlignment: Text.AlignRight
199199 text: audio.lengthToString(modelData["length"])
qml/Dash/Previews/PreviewHeader.qml+1−1
@@ -35,7 +35,7 @@ PreviewWidget {
3535 readonly property url mascot: root.widgetData["mascot"] || ""
3636 readonly property string title: root.widgetData["title"] || ""
3737 readonly property string subtitle: root.widgetData["subtitle"] || ""
38− readonly property color fontColor: root.styleTool.foreground
38+ readonly property color fontColor: root.scopeStyle.foreground
3939
4040 implicitHeight: row.height + row.margins * 2
4141 width: parent.width
qml/Dash/Previews/PreviewRatingDisplay.qml+2−2
@@ -71,7 +71,7 @@ PreviewWidget {
7171 id: authorLabel
7272 objectName: "authorLabel"
7373 anchors { left: parent.left; right: parent.right }
74− color: root.styleTool.foreground
74+ color: root.scopeStyle.foreground
7575 opacity: .8
7676 text: modelData["author"] || ""
7777 visible: text !== ""
@@ -82,7 +82,7 @@ PreviewWidget {
8282 id: reviewLabel
8383 objectName: "reviewLabel"
8484 anchors { left: parent.left; right: parent.right }
85− color: root.styleTool.foreground
85+ color: root.scopeStyle.foreground
8686 opacity: .8
8787 text: modelData["review"] || ""
8888 visible: text !== ""
qml/Dash/Previews/PreviewRatingInput.qml+2−2
@@ -76,7 +76,7 @@ PreviewWidget {
7676 verticalCenter: parent.verticalCenter
7777 left: parent.left
7878 }
79− color: root.styleTool.foreground
79+ color: root.scopeStyle.foreground
8080 opacity: .8
8181 text: widgetData["rating-label"] || i18n.tr("Rate this")
8282 }
@@ -121,7 +121,7 @@ PreviewWidget {
121121 left: parent.left
122122 right: parent.right
123123 }
124− color: root.styleTool.foreground
124+ color: root.scopeStyle.foreground
125125 opacity: .8
126126 text: widgetData["review-label"] || i18n.tr("Add a review")
127127 }
qml/Dash/Previews/PreviewTextSummary.qml+2−2
@@ -39,7 +39,7 @@ PreviewWidget {
3939 }
4040 height: visible ? implicitHeight : 0
4141 fontSize: "large"
42− color: root.styleTool.foreground
42+ color: root.scopeStyle.foreground
4343 visible: text !== ""
4444 opacity: .8
4545 text: widgetData["title"] || ""
@@ -61,7 +61,7 @@ PreviewWidget {
6161 clip: true
6262 fontSize: "small"
6363 lineHeight: 1.2
64− color: root.styleTool.foreground
64+ color: root.scopeStyle.foreground
6565 opacity: .8
6666 text: widgetData["text"]
6767 wrapMode: Text.Wrap
qml/Dash/Previews/PreviewWidget.qml+2−2
@@ -28,8 +28,8 @@ Item {
2828 //! Variable used to contain widget's data
2929 property var widgetData
3030
31− //! The StyleTool component.
32− property var styleTool: { foreground: "grey" }
31+ //! The ScopeStyle component.
32+ property var scopeStyle: { foreground: "grey" }
3333
3434 /*! \brief This signal should be emitted when a preview action was triggered.
3535 *
qml/Dash/Previews/PreviewWidgetFactory.qml+3−3
@@ -31,8 +31,8 @@ Loader {
3131 //! Widget data, forwarded to the widget as is.
3232 property var widgetData: null
3333
34− //! The StyleTool component.
35− property var styleTool: null
34+ //! The ScopeStyle component.
35+ property var scopeStyle: null
3636
3737 //! Set to true if the parent preview is displayed.
3838 property bool isCurrentPreview: false
@@ -65,7 +65,7 @@ Loader {
6565 item.widgetId = Qt.binding(function() { return root.widgetId } )
6666 item.widgetData = Qt.binding(function() { return root.widgetData } )
6767 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;
6969 }
7070
7171 Connections {
tests/plugins/Dash/CMakeLists.txt+1−1
@@ -75,7 +75,7 @@ add_binary_qml_test(CardCreator "" "Dash-qml")
7575
7676# qml unit test
7777set(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)
7979
8080# plain qml test
8181set(qmltest_DEFAULT_TARGETS qmluitests)
tests/plugins/Dash/tst_StyleTool.qml → tests/plugins/Dash/tst_ScopeStyle.qmlrenamed+2−2
@@ -23,13 +23,13 @@ Rectangle {
2323 width: units.gu(40)
2424 height: units.gu(71)
2525
26− StyleTool {
26+ ScopeStyle {
2727 id: tool
2828 }
2929
3030 TestCase {
3131 id: testCase
32− name: "StyleTool"
32+ name: "ScopeStyle"
3333 when: windowShown
3434
3535 property color color
tests/qmltests/Components/tst_PageHeader.qml+1−1
@@ -213,7 +213,7 @@ Item {
213213
214214 searchEntryEnabled: true
215215 title: "%^$%^%^&%^&%^$%GHR%"
216− styleTool: QtObject {
216+ scopeStyle: QtObject {
217217 readonly property color foreground: "grey"
218218 readonly property url headerLogo: showImageCheckBox.checked ? pageHeader.titleImageSource : ""
219219 }