Changeset View
Changeset View
Standalone View
Standalone View
src/qml/PlayListEntry.qml
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU Library General Public License | 14 | * You should have received a copy of the GNU Library General Public License | ||
15 | * along with this library; see the file COPYING.LIB. If not, write to | 15 | * along with this library; see the file COPYING.LIB. If not, write to | ||
16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.7 | 20 | import QtQuick 2.7 | ||
21 | import QtQuick.Layouts 1.2 | 21 | import QtQuick.Layouts 1.2 | ||
22 | import QtQuick.Controls 2.2 | 22 | import QtQuick.Controls 2.3 | ||
23 | import QtQuick.Controls 1.4 as Controls1 | 23 | import QtQuick.Controls 1.4 as Controls1 | ||
24 | import QtQuick.Window 2.2 | 24 | import QtQuick.Window 2.2 | ||
25 | import QtGraphicalEffects 1.0 | 25 | import QtGraphicalEffects 1.0 | ||
26 | import org.kde.elisa 1.0 | 26 | import org.kde.elisa 1.0 | ||
27 | 27 | | |||
28 | FocusScope { | 28 | FocusScope { | ||
29 | id: playListEntry | 29 | id: playListEntry | ||
30 | 30 | | |||
31 | property var index | 31 | property var index | ||
32 | property bool isSingleDiscAlbum | 32 | property bool isSingleDiscAlbum | ||
33 | property int isPlaying | 33 | property int isPlaying | ||
34 | property bool isSelected | 34 | property bool isSelected | ||
35 | property bool isValid | 35 | property bool isValid | ||
36 | property bool isAlternateColor | 36 | property bool isAlternateColor | ||
37 | property bool containsMouse | 37 | property bool containsMouse | ||
38 | property bool hasAlbumHeader | 38 | property bool hasAlbumHeader | ||
39 | property string titleDisplay | 39 | property string titleDisplay | ||
40 | property alias trackData: dataHelper.trackData | 40 | property alias trackData: dataHelper.trackData | ||
41 | property int scrollBarWidth | ||||
41 | 42 | | |||
42 | signal startPlayback() | 43 | signal startPlayback() | ||
43 | signal pausePlayback() | 44 | signal pausePlayback() | ||
44 | signal removeFromPlaylist(var trackIndex) | 45 | signal removeFromPlaylist(var trackIndex) | ||
45 | signal switchToTrack(var trackIndex) | 46 | signal switchToTrack(var trackIndex) | ||
46 | 47 | | |||
47 | height: (hasAlbumHeader ? elisaTheme.delegateWithHeaderHeight : elisaTheme.delegateHeight) | 48 | height: (hasAlbumHeader ? elisaTheme.delegateWithHeaderHeight : elisaTheme.delegateHeight) | ||
48 | 49 | | |||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | 105 | sourceComponent: MediaTrackMetadataView { | |||
107 | onRejected: metadataLoader.active = false; | 108 | onRejected: metadataLoader.active = false; | ||
108 | } | 109 | } | ||
109 | } | 110 | } | ||
110 | 111 | | |||
111 | Rectangle { | 112 | Rectangle { | ||
112 | id: entryBackground | 113 | id: entryBackground | ||
113 | 114 | | |||
114 | anchors.fill: parent | 115 | anchors.fill: parent | ||
116 | anchors.rightMargin: LayoutMirroring.enabled ? scrollBarWidth : 0 | ||||
115 | 117 | | |||
116 | color: (isAlternateColor ? myPalette.alternateBase : myPalette.base) | 118 | color: (isAlternateColor ? myPalette.alternateBase : myPalette.base) | ||
117 | 119 | | |||
118 | height: (hasAlbumHeader ? elisaTheme.delegateWithHeaderHeight : elisaTheme.delegateHeight) | 120 | height: (hasAlbumHeader ? elisaTheme.delegateWithHeaderHeight : elisaTheme.delegateHeight) | ||
119 | 121 | | |||
120 | focus: true | 122 | focus: true | ||
121 | 123 | | |||
122 | ColumnLayout { | 124 | ColumnLayout { | ||
123 | spacing: 0 | 125 | spacing: 0 | ||
124 | 126 | | |||
125 | anchors.fill: parent | 127 | anchors.fill: parent | ||
126 | anchors.leftMargin: elisaTheme.layoutHorizontalMargin | | |||
127 | anchors.rightMargin: elisaTheme.layoutHorizontalMargin | | |||
128 | 128 | | |||
129 | Item { | 129 | Loader { | ||
130 | Layout.fillWidth: true | 130 | Layout.fillWidth: true | ||
131 | Layout.preferredHeight: elisaTheme.delegateWithHeaderHeight - elisaTheme.delegateHeight | 131 | Layout.preferredHeight: elisaTheme.delegateWithHeaderHeight - elisaTheme.delegateHeight | ||
132 | Layout.minimumHeight: elisaTheme.delegateWithHeaderHeight - elisaTheme.delegateHeight | 132 | Layout.minimumHeight: elisaTheme.delegateWithHeaderHeight - elisaTheme.delegateHeight | ||
133 | Layout.maximumHeight: elisaTheme.delegateWithHeaderHeight - elisaTheme.delegateHeight | 133 | Layout.maximumHeight: elisaTheme.delegateWithHeaderHeight - elisaTheme.delegateHeight | ||
134 | 134 | | |||
135 | visible: hasAlbumHeader | 135 | visible: hasAlbumHeader | ||
136 | active: hasAlbumHeader | ||||
137 | | ||||
138 | sourceComponent: Rectangle { | ||||
139 | color: myPalette.midlight | ||||
140 | | ||||
141 | anchors.fill: parent | ||||
136 | 142 | | |||
137 | RowLayout { | 143 | RowLayout { | ||
138 | id: headerRow | 144 | id: headerRow | ||
139 | 145 | | |||
140 | spacing: elisaTheme.layoutHorizontalMargin | 146 | spacing: elisaTheme.layoutHorizontalMargin | ||
141 | 147 | | |||
142 | anchors.fill: parent | 148 | anchors.fill: parent | ||
149 | anchors.topMargin: elisaTheme.layoutVerticalMargin * 1.5 | ||||
150 | anchors.bottomMargin: elisaTheme.layoutVerticalMargin * 1.5 | ||||
143 | 151 | | |||
144 | Image { | 152 | Image { | ||
145 | id: mainIcon | 153 | id: mainIcon | ||
146 | 154 | | |||
147 | source: (isValid ? (dataHelper.hasValidAlbumCover ? dataHelper.albumCover : Qt.resolvedUrl(elisaTheme.defaultAlbumImage)) : Qt.resolvedUrl(elisaTheme.errorIcon)) | 155 | source: (isValid ? (dataHelper.hasValidAlbumCover ? dataHelper.albumCover : Qt.resolvedUrl(elisaTheme.defaultAlbumImage)) : Qt.resolvedUrl(elisaTheme.errorIcon)) | ||
148 | 156 | | |||
149 | Layout.minimumWidth: headerRow.height - 4 | 157 | Layout.minimumWidth: headerRow.height | ||
150 | Layout.maximumWidth: headerRow.height - 4 | 158 | Layout.maximumWidth: headerRow.height | ||
151 | Layout.preferredWidth: headerRow.height - 4 | 159 | Layout.preferredWidth: headerRow.height | ||
152 | Layout.minimumHeight: headerRow.height - 4 | 160 | Layout.minimumHeight: headerRow.height | ||
153 | Layout.maximumHeight: headerRow.height - 4 | 161 | Layout.maximumHeight: headerRow.height | ||
154 | Layout.preferredHeight: headerRow.height - 4 | 162 | Layout.preferredHeight: headerRow.height | ||
163 | Layout.leftMargin: !LayoutMirroring.enabled ? | ||||
164 | (elisaTheme.smallDelegateToolButtonSize + | ||||
165 | trackNumberSize.width + | ||||
166 | fakeDiscNumberSize.width + | ||||
167 | (elisaTheme.layoutHorizontalMargin * 3 / 4) - | ||||
168 | headerRow.height) : | ||||
169 | 0 | ||||
170 | Layout.rightMargin: LayoutMirroring.enabled ? | ||||
171 | (elisaTheme.smallDelegateToolButtonSize + | ||||
172 | trackNumberSize.width + | ||||
173 | fakeDiscNumberSize.width + | ||||
174 | (elisaTheme.layoutHorizontalMargin * 3 / 4) - | ||||
175 | headerRow.height) : | ||||
176 | 0 | ||||
155 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | 177 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
156 | 178 | | |||
157 | sourceSize.width: headerRow.height - 4 | 179 | sourceSize.width: headerRow.height | ||
158 | sourceSize.height: parent.height - 4 | 180 | sourceSize.height: headerRow.height | ||
159 | 181 | | |||
160 | fillMode: Image.PreserveAspectFit | 182 | fillMode: Image.PreserveAspectFit | ||
161 | asynchronous: true | 183 | asynchronous: true | ||
162 | 184 | | |||
163 | visible: isValid | 185 | visible: isValid | ||
164 | } | 186 | } | ||
165 | 187 | | |||
166 | BrightnessContrast { | 188 | BrightnessContrast { | ||
Show All 10 Lines | |||||
177 | Layout.preferredWidth: headerRow.height - 4 | 199 | Layout.preferredWidth: headerRow.height - 4 | ||
178 | Layout.minimumHeight: headerRow.height - 4 | 200 | Layout.minimumHeight: headerRow.height - 4 | ||
179 | Layout.maximumHeight: headerRow.height - 4 | 201 | Layout.maximumHeight: headerRow.height - 4 | ||
180 | Layout.preferredHeight: headerRow.height - 4 | 202 | Layout.preferredHeight: headerRow.height - 4 | ||
181 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | 203 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
182 | } | 204 | } | ||
183 | 205 | | |||
184 | ColumnLayout { | 206 | ColumnLayout { | ||
207 | id: albumHeaderTextColumn | ||||
208 | | ||||
185 | Layout.fillWidth: true | 209 | Layout.fillWidth: true | ||
186 | Layout.fillHeight: true | 210 | Layout.fillHeight: true | ||
211 | Layout.leftMargin: !LayoutMirroring.enabled ? - elisaTheme.layoutHorizontalMargin / 4 : 0 | ||||
212 | Layout.rightMargin: LayoutMirroring.enabled ? - elisaTheme.layoutHorizontalMargin / 4 : 0 | ||||
187 | 213 | | |||
188 | spacing: 0 | 214 | spacing: 0 | ||
189 | 215 | | |||
190 | LabelWithToolTip { | 216 | LabelWithToolTip { | ||
191 | id: mainLabel | 217 | id: mainLabel | ||
192 | text: dataHelper.albumName | 218 | text: dataHelper.albumName | ||
193 | 219 | | |||
194 | font.weight: Font.Bold | 220 | font.weight: Font.Bold | ||
221 | font.pointSize: elisaTheme.defaultFontPointSize * 1.4 | ||||
195 | color: myPalette.text | 222 | color: myPalette.text | ||
196 | 223 | | |||
197 | horizontalAlignment: Text.AlignHCenter | 224 | horizontalAlignment: Text.AlignLeft | ||
198 | 225 | | |||
199 | Layout.fillWidth: true | 226 | Layout.fillWidth: true | ||
200 | Layout.alignment: Qt.AlignCenter | 227 | Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft | ||
201 | Layout.topMargin: elisaTheme.layoutVerticalMargin | 228 | Layout.topMargin: elisaTheme.layoutVerticalMargin | ||
202 | 229 | | |||
203 | elide: Text.ElideRight | 230 | elide: Text.ElideRight | ||
204 | } | 231 | } | ||
205 | 232 | | |||
206 | Item { | 233 | Item { | ||
207 | Layout.fillHeight: true | 234 | Layout.fillHeight: true | ||
208 | } | 235 | } | ||
209 | 236 | | |||
210 | LabelWithToolTip { | 237 | LabelWithToolTip { | ||
211 | id: authorLabel | 238 | id: authorLabel | ||
212 | 239 | | |||
213 | text: dataHelper.albumArtist | 240 | text: dataHelper.albumArtist | ||
214 | 241 | | |||
215 | font.weight: Font.Light | 242 | font.weight: Font.Light | ||
216 | color: myPalette.text | 243 | color: myPalette.text | ||
217 | 244 | | |||
218 | horizontalAlignment: Text.AlignHCenter | 245 | horizontalAlignment: Text.AlignLeft | ||
219 | 246 | | |||
220 | Layout.fillWidth: true | 247 | Layout.fillWidth: true | ||
221 | Layout.alignment: Qt.AlignCenter | 248 | Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft | ||
222 | Layout.bottomMargin: elisaTheme.layoutVerticalMargin | 249 | Layout.bottomMargin: elisaTheme.layoutVerticalMargin | ||
223 | 250 | | |||
224 | elide: Text.ElideRight | 251 | elide: Text.ElideRight | ||
225 | } | 252 | } | ||
226 | } | 253 | } | ||
227 | } | 254 | } | ||
228 | } | 255 | } | ||
256 | } | ||||
229 | 257 | | |||
230 | Item { | 258 | Item { | ||
231 | Layout.fillWidth: true | 259 | Layout.fillWidth: true | ||
232 | Layout.fillHeight: true | 260 | Layout.fillHeight: true | ||
233 | 261 | | |||
234 | RowLayout { | 262 | RowLayout { | ||
235 | id: trackRow | 263 | id: trackRow | ||
236 | 264 | | |||
237 | anchors.fill: parent | 265 | anchors.fill: parent | ||
238 | 266 | | |||
239 | spacing: elisaTheme.layoutHorizontalMargin | 267 | spacing: elisaTheme.layoutHorizontalMargin / 4 | ||
240 | 268 | | |||
241 | LabelWithToolTip { | 269 | Item { | ||
242 | id: mainCompactLabel | 270 | id: playIconItem | ||
271 | | ||||
272 | implicitHeight: elisaTheme.smallDelegateToolButtonSize | ||||
273 | implicitWidth: elisaTheme.smallDelegateToolButtonSize | ||||
274 | Layout.maximumWidth: elisaTheme.smallDelegateToolButtonSize | ||||
275 | Layout.maximumHeight: elisaTheme.smallDelegateToolButtonSize | ||||
276 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||||
277 | | ||||
278 | Image { | ||||
279 | id: playIcon | ||||
280 | | ||||
281 | anchors.fill: parent | ||||
282 | | ||||
283 | opacity: 0 | ||||
243 | 284 | | |||
244 | text: { | 285 | source: (isPlaying === MediaPlayList.IsPlaying ? | ||
245 | if (dataHelper.hasValidTrackNumber) { | 286 | Qt.resolvedUrl(elisaTheme.playingIndicatorIcon) : Qt.resolvedUrl(elisaTheme.pausedIndicatorIcon)) | ||
246 | if (dataHelper.hasValidDiscNumber && !isSingleDiscAlbum) | 287 | | ||
247 | return i18nc("%1: disk number. %2: track number. %3: track title", "%1 - %2 - %3", | 288 | width: parent.height * 1. | ||
248 | Number(dataHelper.discNumber).toLocaleString(Qt.locale(), 'f', 0), | 289 | height: parent.height * 1. | ||
249 | Number(dataHelper.trackNumber).toLocaleString(Qt.locale(), 'f', 0), dataHelper.title); | 290 | | ||
250 | else | 291 | sourceSize.width: parent.height * 1. | ||
251 | return i18nc("%1: track number. %2: track title", "%1 - %2", | 292 | sourceSize.height: parent.height * 1. | ||
252 | Number(dataHelper.trackNumber).toLocaleString(Qt.locale(), 'f', 0), dataHelper.title); | 293 | fillMode: Image.PreserveAspectFit | ||
253 | } else { | 294 | mirror: LayoutMirroring.enabled | ||
254 | return dataHelper.title; | 295 | visible: opacity > 0.0 | ||
255 | } | 296 | } | ||
256 | } | 297 | } | ||
257 | 298 | | |||
299 | Item { | ||||
300 | id: fakeDiscNumberItem | ||||
301 | | ||||
302 | visible: isValid && (!dataHelper.hasValidDiscNumber || isSingleDiscAlbum) | ||||
303 | | ||||
304 | Layout.preferredWidth: fakeDiscNumberSize.width + (elisaTheme.layoutHorizontalMargin / 4) | ||||
305 | Layout.minimumWidth: fakeDiscNumberSize.width + (elisaTheme.layoutHorizontalMargin / 4) | ||||
306 | Layout.maximumWidth: fakeDiscNumberSize.width + (elisaTheme.layoutHorizontalMargin / 4) | ||||
307 | | ||||
308 | TextMetrics { | ||||
309 | id: fakeDiscNumberSize | ||||
310 | | ||||
311 | text: '/9' | ||||
312 | } | ||||
313 | } | ||||
314 | | ||||
315 | Label { | ||||
316 | id: trackNumberLabel | ||||
317 | | ||||
318 | horizontalAlignment: Text.AlignRight | ||||
319 | | ||||
320 | text: dataHelper.hasValidTrackNumber ? Number(dataHelper.trackNumber).toLocaleString(Qt.locale(), 'f', 0) : '' | ||||
321 | | ||||
322 | font.weight: (isPlaying ? Font.Bold : Font.Light) | ||||
323 | color: myPalette.text | ||||
324 | | ||||
325 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||||
326 | | ||||
327 | visible: isValid | ||||
328 | | ||||
329 | Layout.preferredWidth: (trackNumberSize.width > realTrackNumberSize.width ? trackNumberSize.width : realTrackNumberSize.width) | ||||
330 | Layout.minimumWidth: (trackNumberSize.width > realTrackNumberSize.width ? trackNumberSize.width : realTrackNumberSize.width) | ||||
331 | Layout.maximumWidth: (trackNumberSize.width > realTrackNumberSize.width ? trackNumberSize.width : realTrackNumberSize.width) | ||||
332 | | ||||
333 | Layout.rightMargin: !LayoutMirroring.enabled ? (dataHelper.hasValidDiscNumber && !isSingleDiscAlbum ? | ||||
334 | 0 : elisaTheme.layoutHorizontalMargin / 2) : 0 | ||||
335 | Layout.leftMargin: LayoutMirroring.enabled ? (dataHelper.hasValidDiscNumber && !isSingleDiscAlbum ? | ||||
336 | 0 : elisaTheme.layoutHorizontalMargin / 2) : 0 | ||||
337 | | ||||
338 | TextMetrics { | ||||
339 | id: trackNumberSize | ||||
340 | | ||||
341 | text: (99).toLocaleString(Qt.locale(), 'f', 0) | ||||
342 | } | ||||
343 | | ||||
344 | TextMetrics { | ||||
345 | id: realTrackNumberSize | ||||
346 | | ||||
347 | text: Number(dataHelper.trackNumber).toLocaleString(Qt.locale(), 'f', 0) | ||||
348 | } | ||||
349 | } | ||||
350 | | ||||
351 | Label { | ||||
352 | horizontalAlignment: Text.AlignCenter | ||||
353 | | ||||
354 | text: '/' | ||||
355 | | ||||
356 | visible: isValid && dataHelper.hasValidDiscNumber && !isSingleDiscAlbum | ||||
357 | | ||||
358 | font.weight: (isPlaying ? Font.Bold : Font.Light) | ||||
359 | color: myPalette.text | ||||
360 | | ||||
361 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||||
362 | | ||||
363 | Layout.preferredWidth: numberSeparatorSize.width | ||||
364 | Layout.minimumWidth: numberSeparatorSize.width | ||||
365 | Layout.maximumWidth: numberSeparatorSize.width | ||||
366 | | ||||
367 | TextMetrics { | ||||
368 | id: numberSeparatorSize | ||||
369 | | ||||
370 | text: '/' | ||||
371 | } | ||||
372 | } | ||||
373 | | ||||
374 | Label { | ||||
375 | horizontalAlignment: Text.AlignRight | ||||
376 | | ||||
377 | font.weight: (isPlaying ? Font.Bold : Font.Light) | ||||
378 | color: myPalette.text | ||||
379 | | ||||
380 | text: Number(dataHelper.discNumber).toLocaleString(Qt.locale(), 'f', 0) | ||||
381 | | ||||
382 | visible: isValid && dataHelper.hasValidDiscNumber && !isSingleDiscAlbum | ||||
383 | | ||||
384 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||||
385 | | ||||
386 | Layout.preferredWidth: (discNumberSize.width > realDiscNumberSize.width ? discNumberSize.width : realDiscNumberSize.width) | ||||
387 | Layout.minimumWidth: (discNumberSize.width > realDiscNumberSize.width ? discNumberSize.width : realDiscNumberSize.width) | ||||
388 | Layout.maximumWidth: (discNumberSize.width > realDiscNumberSize.width ? discNumberSize.width : realDiscNumberSize.width) | ||||
389 | | ||||
390 | Layout.rightMargin: !LayoutMirroring.enabled ? (elisaTheme.layoutHorizontalMargin / 2) : 0 | ||||
391 | Layout.leftMargin: LayoutMirroring.enabled ? (elisaTheme.layoutHorizontalMargin / 2) : 0 | ||||
392 | | ||||
393 | TextMetrics { | ||||
394 | id: discNumberSize | ||||
395 | | ||||
396 | text: '9' | ||||
397 | } | ||||
398 | | ||||
399 | TextMetrics { | ||||
400 | id: realDiscNumberSize | ||||
401 | | ||||
402 | text: Number(dataHelper.discNumber).toLocaleString(Qt.locale(), 'f', 0) | ||||
403 | } | ||||
404 | } | ||||
405 | | ||||
406 | LabelWithToolTip { | ||||
407 | id: mainCompactLabel | ||||
408 | | ||||
409 | text: dataHelper.title | ||||
410 | | ||||
258 | font.weight: (isPlaying ? Font.Bold : Font.Normal) | 411 | font.weight: (isPlaying ? Font.Bold : Font.Normal) | ||
259 | color: myPalette.text | 412 | color: myPalette.text | ||
260 | 413 | | |||
261 | Layout.maximumWidth: mainCompactLabel.implicitWidth + 1 | 414 | Layout.maximumWidth: mainCompactLabel.implicitWidth + 1 | ||
262 | Layout.fillWidth: true | 415 | Layout.fillWidth: true | ||
263 | Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft | 416 | Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft | ||
264 | 417 | | |||
265 | visible: isValid | 418 | visible: isValid | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
307 | Controls1.ToolButton { | 460 | Controls1.ToolButton { | ||
308 | id: playPauseButton | 461 | id: playPauseButton | ||
309 | objectName: 'playPauseButton' | 462 | objectName: 'playPauseButton' | ||
310 | 463 | | |||
311 | implicitHeight: elisaTheme.smallDelegateToolButtonSize | 464 | implicitHeight: elisaTheme.smallDelegateToolButtonSize | ||
312 | implicitWidth: elisaTheme.smallDelegateToolButtonSize | 465 | implicitWidth: elisaTheme.smallDelegateToolButtonSize | ||
313 | 466 | | |||
314 | opacity: 0 | 467 | opacity: 0 | ||
468 | | ||||
315 | scale: LayoutMirroring.enabled ? -1 : 1 // We can mirror the symmetrical pause icon | 469 | scale: LayoutMirroring.enabled ? -1 : 1 // We can mirror the symmetrical pause icon | ||
316 | 470 | | |||
317 | visible: opacity > 0.1 | 471 | visible: opacity > 0.1 | ||
318 | action: !(isPlaying === MediaPlayList.IsPlaying) ? playNow : pauseNow | 472 | action: !(isPlaying === MediaPlayList.IsPlaying) ? playNow : pauseNow | ||
319 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 473 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
320 | } | 474 | } | ||
321 | 475 | | |||
322 | Item { | 476 | Item { | ||
Show All 9 Lines | 483 | Controls1.ToolButton { | |||
332 | 486 | | |||
333 | anchors.fill: parent | 487 | anchors.fill: parent | ||
334 | 488 | | |||
335 | opacity: 0 | 489 | opacity: 0 | ||
336 | 490 | | |||
337 | visible: opacity > 0.1 | 491 | visible: opacity > 0.1 | ||
338 | action: removeFromPlayList | 492 | action: removeFromPlayList | ||
339 | } | 493 | } | ||
340 | | ||||
341 | Image { | | |||
342 | id: playIcon | | |||
343 | | ||||
344 | anchors.fill: parent | | |||
345 | | ||||
346 | opacity: 0 | | |||
347 | | ||||
348 | source: (isPlaying === MediaPlayList.IsPlaying ? | | |||
349 | Qt.resolvedUrl(elisaTheme.playingIndicatorIcon) : Qt.resolvedUrl(elisaTheme.pausedIndicatorIcon)) | | |||
350 | | ||||
351 | width: parent.height * 1. | | |||
352 | height: parent.height * 1. | | |||
353 | sourceSize.width: parent.height * 1. | | |||
354 | sourceSize.height: parent.height * 1. | | |||
355 | fillMode: Image.PreserveAspectFit | | |||
356 | mirror: LayoutMirroring.enabled | | |||
357 | visible: opacity > 0.0 | | |||
358 | } | | |||
359 | } | 494 | } | ||
360 | 495 | | |||
361 | RatingStar { | 496 | RatingStar { | ||
362 | id: ratingWidget | 497 | id: ratingWidget | ||
363 | 498 | | |||
364 | starRating: dataHelper.rating | 499 | starRating: dataHelper.rating | ||
365 | 500 | | |||
366 | starSize: elisaTheme.ratingStarSize | 501 | starSize: elisaTheme.ratingStarSize | ||
367 | } | 502 | } | ||
368 | 503 | | |||
369 | TextMetrics { | 504 | TextMetrics { | ||
370 | id: durationTextMetrics | 505 | id: durationTextMetrics | ||
371 | text: i18nc("This is used to preserve a fixed width for the duration text.", "00:00") | 506 | text: i18nc("This is used to preserve a fixed width for the duration text.", "00:00") | ||
372 | } | 507 | } | ||
373 | 508 | | |||
374 | LabelWithToolTip { | 509 | LabelWithToolTip { | ||
375 | id: durationLabel | 510 | id: durationLabel | ||
376 | 511 | | |||
377 | text: dataHelper.duration | 512 | text: dataHelper.duration | ||
378 | 513 | | |||
514 | font.weight: (isPlaying ? Font.Bold : Font.Normal) | ||||
379 | color: myPalette.text | 515 | color: myPalette.text | ||
380 | 516 | | |||
381 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 517 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
382 | Layout.preferredWidth: durationTextMetrics.width + 1 | 518 | Layout.preferredWidth: durationTextMetrics.width + 1 | ||
519 | Layout.leftMargin: elisaTheme.layoutHorizontalMargin / 2 | ||||
520 | Layout.rightMargin: elisaTheme.layoutHorizontalMargin / 2 | ||||
383 | 521 | | |||
384 | horizontalAlignment: Text.AlignRight | 522 | horizontalAlignment: Text.AlignRight | ||
385 | } | 523 | } | ||
386 | } | 524 | } | ||
387 | } | 525 | } | ||
388 | } | 526 | } | ||
389 | } | 527 | } | ||
390 | 528 | | |||
Show All 38 Lines | 565 | PropertyChanges { | |||
429 | opacity: 1 | 567 | opacity: 1 | ||
430 | } | 568 | } | ||
431 | PropertyChanges { | 569 | PropertyChanges { | ||
432 | target: infoButton | 570 | target: infoButton | ||
433 | opacity: 1 | 571 | opacity: 1 | ||
434 | } | 572 | } | ||
435 | PropertyChanges { | 573 | PropertyChanges { | ||
436 | target: playIcon | 574 | target: playIcon | ||
437 | opacity: 0 | 575 | opacity: (isPlaying === MediaPlayList.IsPlaying || isPlaying === MediaPlayList.IsPaused ? 1.0 : 0.0) | ||
438 | } | 576 | } | ||
439 | PropertyChanges { | 577 | PropertyChanges { | ||
440 | target: entryBackground | 578 | target: entryBackground | ||
441 | color: myPalette.mid | 579 | color: myPalette.mid | ||
442 | } | 580 | } | ||
443 | PropertyChanges { | 581 | PropertyChanges { | ||
444 | target: ratingWidget | 582 | target: ratingWidget | ||
445 | hoverWidgetOpacity: 1.0 | 583 | hoverWidgetOpacity: 1.0 | ||
Show All 18 Lines |