on xenial help sign in
Implement StyleTool usage in preview widgets.
b90aabdMichał Sawicz
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: "grey"//Theme.palette.selected.backgroundText // TODO karni: Use updated Palette.
142+ color: styleTool.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: "grey"//Theme.palette.selected.backgroundText // TODO karni: Use updated Palette.
155+ color: styleTool.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: "grey"//Theme.palette.selected.backgroundText // TODO karni: Use updated Palette.
196+ color: styleTool.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: "grey"
38+ readonly property color fontColor: root.styleTool.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−4
@@ -71,8 +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− // TODO cimi: Yet another fix requiring Palette update.
74+ color: root.styleTool.foreground
75− color: "grey" //Theme.palette.selected.backgroundText
76 opacity: .8
75 opacity: .8
77 text: modelData["author"] || ""
76 text: modelData["author"] || ""
78 visible: text !== ""
77 visible: text !== ""
@@ -83,8 +82,7 @@ PreviewWidget {
83 id: reviewLabel
82 id: reviewLabel
84 objectName: "reviewLabel"
83 objectName: "reviewLabel"
85 anchors { left: parent.left; right: parent.right }
84 anchors { left: parent.left; right: parent.right }
86− // TODO cimi: Yet another fix requiring Palette update.
85+ color: root.styleTool.foreground
87− color: "grey" //Theme.palette.selected.backgroundText
88 opacity: .8
86 opacity: .8
89 text: modelData["review"] || ""
87 text: modelData["review"] || ""
90 visible: text !== ""
88 visible: text !== ""
qml/Dash/Previews/PreviewRatingInput.qml+2−4
@@ -76,8 +76,7 @@ PreviewWidget {
76 verticalCenter: parent.verticalCenter
76 verticalCenter: parent.verticalCenter
77 left: parent.left
77 left: parent.left
78 }
78 }
79− // TODO cimi: Yet another fix requiring Palette update.
79+ color: root.styleTool.foreground
80− color: "grey" //Theme.palette.selected.backgroundText
81 opacity: .8
80 opacity: .8
82 text: widgetData["rating-label"] || i18n.tr("Rate this")
81 text: widgetData["rating-label"] || i18n.tr("Rate this")
83 }
82 }
@@ -122,8 +121,7 @@ PreviewWidget {
122 left: parent.left
121 left: parent.left
123 right: parent.right
122 right: parent.right
124 }
123 }
125− // TODO cimi: Yet another fix requiring Palette update.
124+ color: root.styleTool.foreground
126− color: "grey" //Theme.palette.selected.backgroundText
127 opacity: .8
125 opacity: .8
128 text: widgetData["review-label"] || i18n.tr("Add a review")
126 text: widgetData["review-label"] || i18n.tr("Add a review")
129 }
127 }
qml/Dash/Previews/PreviewTextSummary.qml+2−4
@@ -39,8 +39,7 @@ PreviewWidget {
39 }
39 }
40 height: visible ? implicitHeight : 0
40 height: visible ? implicitHeight : 0
41 fontSize: "large"
41 fontSize: "large"
42− // TODO karni: Yet another fix requiring Palette update.
42+ color: root.styleTool.foreground
43− color: "grey" //Theme.palette.selected.backgroundText
44 visible: text !== ""
43 visible: text !== ""
45 opacity: .8
44 opacity: .8
46 text: widgetData["title"] || ""
45 text: widgetData["title"] || ""
@@ -62,8 +61,7 @@ PreviewWidget {
62 clip: true
61 clip: true
63 fontSize: "small"
62 fontSize: "small"
64 lineHeight: 1.2
63 lineHeight: 1.2
65− // TODO karni: Yet another fix requiring Palette update.
64+ color: root.styleTool.foreground
66− color: "grey" //Theme.palette.selected.backgroundText
67 opacity: .8
65 opacity: .8
68 text: widgetData["text"]
66 text: widgetData["text"]
69 wrapMode: Text.Wrap
67 wrapMode: Text.Wrap
qml/Dash/Previews/PreviewWidget.qml+3
@@ -28,6 +28,9 @@ 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.
32+ property var styleTool: { foreground: "grey" }
33+
31 /*! \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.
32 *
35 *
33 * \param widgetId, actionId Respective identifiers from widgetData.
36 * \param widgetId, actionId Respective identifiers from widgetData.
qml/Dash/Previews/PreviewWidgetFactory.qml+1
@@ -65,6 +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 }
69 }
69
70
70 Connections {
71 Connections {