on xenial help sign in
Implement StyleTool usage in preview widgets.
commitb90aabd87874bbdee254929153b5cd5ad55caf24 authorMichał Sawicz <michal.sawicz@canonical.com> dateMon 7 Jul 2014, 00:25 (12 years ago) parent6c03f35
7 files changed+14−16
qml/Dash/Previews/PreviewAudioPlayback.qml+3−3 qml/Dash/Previews/PreviewHeader.qml+1−1 qml/Dash/Previews/PreviewRatingDisplay.qml+2−4 qml/Dash/Previews/PreviewRatingInput.qml+2−4 qml/Dash/Previews/PreviewTextSummary.qml+2−4 qml/Dash/Previews/PreviewWidget.qml+3 qml/Dash/Previews/PreviewWidgetFactory.qml+1
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: "grey"//Theme.palette.selected.backgroundText // TODO karni: Use updated Palette.
142+ color: styleTool.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: "grey"//Theme.palette.selected.backgroundText // TODO karni: Use updated Palette.
155+ color: styleTool.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: "grey"//Theme.palette.selected.backgroundText // TODO karni: Use updated Palette.
196+ color: styleTool.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: "grey"
38+ readonly property color fontColor: root.styleTool.foreground
3939
4040 implicitHeight: row.height + row.margins * 2
4141 width: parent.width
qml/Dash/Previews/PreviewRatingDisplay.qml+2−4
@@ -71,8 +71,7 @@ PreviewWidget {
7171 id: authorLabel
7272 objectName: "authorLabel"
7373 anchors { left: parent.left; right: parent.right }
74− // TODO cimi: Yet another fix requiring Palette update.
75− color: "grey" //Theme.palette.selected.backgroundText
74+ color: root.styleTool.foreground
7675 opacity: .8
7776 text: modelData["author"] || ""
7877 visible: text !== ""
@@ -83,8 +82,7 @@ PreviewWidget {
8382 id: reviewLabel
8483 objectName: "reviewLabel"
8584 anchors { left: parent.left; right: parent.right }
86− // TODO cimi: Yet another fix requiring Palette update.
87− color: "grey" //Theme.palette.selected.backgroundText
85+ color: root.styleTool.foreground
8886 opacity: .8
8987 text: modelData["review"] || ""
9088 visible: text !== ""
qml/Dash/Previews/PreviewRatingInput.qml+2−4
@@ -76,8 +76,7 @@ PreviewWidget {
7676 verticalCenter: parent.verticalCenter
7777 left: parent.left
7878 }
79− // TODO cimi: Yet another fix requiring Palette update.
80− color: "grey" //Theme.palette.selected.backgroundText
79+ color: root.styleTool.foreground
8180 opacity: .8
8281 text: widgetData["rating-label"] || i18n.tr("Rate this")
8382 }
@@ -122,8 +121,7 @@ PreviewWidget {
122121 left: parent.left
123122 right: parent.right
124123 }
125− // TODO cimi: Yet another fix requiring Palette update.
126− color: "grey" //Theme.palette.selected.backgroundText
124+ color: root.styleTool.foreground
127125 opacity: .8
128126 text: widgetData["review-label"] || i18n.tr("Add a review")
129127 }
qml/Dash/Previews/PreviewTextSummary.qml+2−4
@@ -39,8 +39,7 @@ PreviewWidget {
3939 }
4040 height: visible ? implicitHeight : 0
4141 fontSize: "large"
42− // TODO karni: Yet another fix requiring Palette update.
43− color: "grey" //Theme.palette.selected.backgroundText
42+ color: root.styleTool.foreground
4443 visible: text !== ""
4544 opacity: .8
4645 text: widgetData["title"] || ""
@@ -62,8 +61,7 @@ PreviewWidget {
6261 clip: true
6362 fontSize: "small"
6463 lineHeight: 1.2
65− // TODO karni: Yet another fix requiring Palette update.
66− color: "grey" //Theme.palette.selected.backgroundText
64+ color: root.styleTool.foreground
6765 opacity: .8
6866 text: widgetData["text"]
6967 wrapMode: Text.Wrap
qml/Dash/Previews/PreviewWidget.qml+3
@@ -28,6 +28,9 @@ Item {
2828 //! Variable used to contain widget's data
2929 property var widgetData
3030
31+ //! The StyleTool component.
32+ property var styleTool: { foreground: "grey" }
33+
3134 /*! \brief This signal should be emitted when a preview action was triggered.
3235 *
3336 * \param widgetId, actionId Respective identifiers from widgetData.
qml/Dash/Previews/PreviewWidgetFactory.qml+1
@@ -65,6 +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;
6869 }
6970
7071 Connections {