Changeset View
Standalone View
src/qml/PlayListEntry.qml
Show First 20 Lines • Show All 240 Lines • ▼ Show 20 Line(s) | 238 | Item { | |||
---|---|---|---|---|---|
241 | 241 | | |||
242 | RowLayout { | 242 | RowLayout { | ||
243 | id: trackRow | 243 | id: trackRow | ||
244 | 244 | | |||
245 | anchors.fill: parent | 245 | anchors.fill: parent | ||
246 | 246 | | |||
247 | spacing: elisaTheme.layoutHorizontalMargin | 247 | spacing: elisaTheme.layoutHorizontalMargin | ||
248 | 248 | | |||
249 | LabelWithToolTip { | 249 | LabelWithToolTip { | ||
safaalfulaij: {F5677221}
This one is for the disk/track numbers.
I felt that it's not great to have the id… | |||||
250 | id: mainCompactLabel | 250 | id: mainCompactLabel | ||
251 | 251 | | |||
252 | text: (trackNumber > -1 ? (((discNumber && !isSingleDiscAlbum) ? discNumber + ' - ' + trackNumber : trackNumber) + ' - ' + title) : title) | 252 | text: { | ||
253 | if (trackNumber > -1) { | ||||
Could you try to use i18n to compose the string to be translated ? mgallien: Could you try to use i18n to compose the string to be translated ?
I am not sure if it is… | |||||
Sure we don't need translate the empty "", but yes we can provide the other returns a translatable locale-aware version. safaalfulaij: Sure we don't need translate the empty "", but yes we can provide the other returns a… | |||||
254 | if (discNumber && !isSingleDiscAlbum) | ||||
255 | return i18nc("%1: disk number. %2: track number. %3: track title", "%1 - %2 - %3", | ||||
256 | Number(discNumber).toLocaleString(Qt.locale(), 'f', 0), | ||||
257 | Number(trackNumber).toLocaleString(Qt.locale(), 'f', 0), title); | ||||
258 | else | ||||
259 | return i18nc("%1: track number. %2: track title", "%1 - %2", | ||||
260 | Number(trackNumber).toLocaleString(Qt.locale(), 'f', 0), title); | ||||
261 | } else { | ||||
262 | return title; | ||||
263 | } | ||||
264 | } | ||||
253 | 265 | | |||
254 | font.weight: (isPlaying ? Font.Bold : Font.Normal) | 266 | font.weight: (isPlaying ? Font.Bold : Font.Normal) | ||
255 | color: myPalette.text | 267 | color: myPalette.text | ||
256 | 268 | | |||
257 | Layout.maximumWidth: mainCompactLabel.implicitWidth + 1 | 269 | Layout.maximumWidth: mainCompactLabel.implicitWidth + 1 | ||
258 | Layout.fillWidth: true | 270 | Layout.fillWidth: true | ||
safaalfulaij: {F5677235}
This is now strange, not sure how to proceed
First try is to make two… | |||||
You can check the other screenshot down showing the duration label's size fixing. Maybe we don't really need to change this at all, and just keep it looks a part of the track itself. If we'll go with this soloution, maybe we can have ons string to get the maximum digit width, and then just multiply that with some added value to be on the safe side. safaalfulaij: You can check the other screenshot down showing the duration label's size fixing.
Maybe we… | |||||
259 | Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft | 271 | Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft | ||
260 | 272 | | |||
261 | visible: isValid | 273 | visible: isValid | ||
262 | 274 | | |||
263 | elide: Text.ElideRight | 275 | elide: Text.ElideRight | ||
276 | horizontalAlignment: Text.AlignLeft | ||||
264 | } | 277 | } | ||
265 | 278 | | |||
266 | LabelWithToolTip { | 279 | LabelWithToolTip { | ||
267 | id: mainInvalidCompactLabel | 280 | id: mainInvalidCompactLabel | ||
268 | 281 | | |||
269 | text: title | 282 | text: title | ||
270 | 283 | | |||
271 | font.weight: Font.Normal | 284 | font.weight: Font.Normal | ||
Show All 29 Lines | |||||
301 | 314 | | |||
302 | ToolButton { | 315 | ToolButton { | ||
303 | id: playPauseButton | 316 | id: playPauseButton | ||
304 | 317 | | |||
305 | implicitHeight: elisaTheme.smallDelegateToolButtonSize | 318 | implicitHeight: elisaTheme.smallDelegateToolButtonSize | ||
306 | implicitWidth: elisaTheme.smallDelegateToolButtonSize | 319 | implicitWidth: elisaTheme.smallDelegateToolButtonSize | ||
307 | 320 | | |||
308 | opacity: 0 | 321 | opacity: 0 | ||
322 | scale: LayoutMirroring.enabled ? -1 : 1 // We can mirror the symmetrical pause icon | ||||
safaalfulaij: {F5677210} | |||||
safaalfulaij: That was the wrong screenshot, the right one have the icon as in LTR layout:
{F5690058} | |||||
309 | 323 | | |||
310 | visible: opacity > 0.1 | 324 | visible: opacity > 0.1 | ||
311 | action: !(isPlaying == MediaPlayList.IsPlaying) ? playNow : pauseNow | 325 | action: !(isPlaying == MediaPlayList.IsPlaying) ? playNow : pauseNow | ||
312 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 326 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
313 | } | 327 | } | ||
314 | 328 | | |||
315 | Item { | 329 | Item { | ||
316 | implicitHeight: elisaTheme.smallDelegateToolButtonSize | 330 | implicitHeight: elisaTheme.smallDelegateToolButtonSize | ||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | |||||
390 | } | 404 | } | ||
391 | 405 | | |||
392 | RatingStar { | 406 | RatingStar { | ||
393 | id: ratingWidget | 407 | id: ratingWidget | ||
394 | 408 | | |||
395 | starSize: elisaTheme.ratingStarSize | 409 | starSize: elisaTheme.ratingStarSize | ||
396 | } | 410 | } | ||
397 | 411 | | |||
412 | TextMetrics { | ||||
safaalfulaij: {F5677221}
Same issue making the layout not-polished and the rating going right and left, but… | |||||
safaalfulaij: LTR:
{F5690060}
(The duration only) | |||||
413 | id: durationTextMetrics | ||||
414 | text: i18nc("This is used to preserve a fixed width for the duration text.", "00:00") | ||||
mgallien: Same comment for individuals track, keep only minutes and seconds. | |||||
415 | } | ||||
416 | | ||||
398 | LabelWithToolTip { | 417 | LabelWithToolTip { | ||
399 | id: durationLabel | 418 | id: durationLabel | ||
419 | | ||||
400 | text: duration | 420 | text: duration | ||
401 | 421 | | |||
402 | color: myPalette.text | 422 | color: myPalette.text | ||
403 | 423 | | |||
404 | elide: Text.ElideRight | 424 | elide: Text.ElideRight | ||
405 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 425 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
426 | Layout.preferredWidth: durationTextMetrics.width+1 // be in the safe side | ||||
427 | | ||||
428 | horizontalAlignment: Text.AlignRight | ||||
406 | } | 429 | } | ||
407 | } | 430 | } | ||
408 | } | 431 | } | ||
409 | } | 432 | } | ||
410 | } | 433 | } | ||
411 | 434 | | |||
412 | states: [ | 435 | states: [ | ||
413 | State { | 436 | State { | ||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |
This one is for the disk/track numbers.
I felt that it's not great to have the id moving right and left.