Merge lp:~ahayzen/music-app/remix-albums-page-card-view into lp:music-app/remix

Proposed by Andrew Hayzen
Status: Merged
Approved by: Victor Thompson
Approved revision: 673
Merged at revision: 673
Proposed branch: lp:~ahayzen/music-app/remix-albums-page-card-view
Merge into: lp:music-app/remix
Diff against target: 1145 lines (+384/-587)
7 files modified
MusicArtists.qml (+1/-1)
common/AlbumsPage.qml (+113/-364)
common/BlurredHeader.qml (+73/-0)
common/CardView.qml (+24/-6)
common/SongsPage.qml (+133/-176)
po/com.ubuntu.music.pot (+38/-38)
tests/autopilot/music_app/__init__.py (+2/-2)
To merge this branch: bzr merge lp:~ahayzen/music-app/remix-albums-page-card-view
Reviewer Review Type Date Requested Status
Victor Thompson Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+238318@code.launchpad.net

Commit message

* Add support for CardView in AlbumsPage.qml
* Add support for header property in CardView.qml
* Add BlurredHeader.qml
* Make AlbumsPage.qml and SongsPage.qml use BlurredHeader.qml

Description of the change

* Add support for CardView in AlbumsPage.qml
* Add support for header property in CardView.qml
* Add BlurredHeader.qml
* Make AlbumsPage.qml and SongsPage.qml use BlurredHeader.qml

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
672. By Andrew Hayzen

* Fixes for autopilot

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

I think having the button column and a label column is probably good for now, but really they are more positional then strictly "button" or "label" related. Would having a right and bottom (rightColumn and bottomColumn" or similar property make more sense over all? The code reads better having as it is now with a "buttons" and "labels" property, but it may be more understandable if they are named for their position. What do you think?

review: Needs Information
Revision history for this message
Victor Thompson (vthompson) wrote :

One functional thing I've noticed is that while the labels do have an elide, the labels are not effectively eliding. I think you need to set up the anchors properly so the Labels are the proper width with the proper margins.

review: Needs Fixing
673. By Andrew Hayzen

* Use rightColumn and bottomColumn instead of buttons and labels
* Fix for labels in columns not eliding

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Done, please retest :)

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

I was going to suggest we also update the translatable strings as part of this since they've been moved around. However, none of them have changed--so LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MusicArtists.qml'
2--- MusicArtists.qml 2014-10-13 14:18:01 +0000
3+++ MusicArtists.qml 2014-10-16 23:40:22 +0000
4@@ -74,7 +74,7 @@
5
6 onClicked: {
7 albumsPage.artist = model.artist;
8- albumsPage.covers = [{art: artistCard.imageSource}]
9+ albumsPage.covers = artistCard.coverSources
10 albumsPage.title = i18n.tr("Artist")
11
12 mainPageStack.push(albumsPage)
13
14=== modified file 'common/AlbumsPage.qml'
15--- common/AlbumsPage.qml 2014-10-07 02:18:54 +0000
16+++ common/AlbumsPage.qml 2014-10-16 23:40:22 +0000
17@@ -34,378 +34,127 @@
18 property string artist: ""
19 property var covers: []
20
21- ListView {
22- id: albumtrackslist
23+ CardView {
24+ id: artistAlbumView
25 anchors {
26 fill: parent
27 }
28- delegate: albumTracksDelegate
29- header: artistHeaderDelegate
30+ header: BlurredHeader {
31+ rightColumn: Column {
32+ spacing: units.gu(2)
33+ Button {
34+ id: shuffleRow
35+ height: units.gu(4)
36+ strokeColor: UbuntuColors.green
37+ width: units.gu(15)
38+ Text {
39+ anchors {
40+ centerIn: parent
41+ }
42+ color: "white"
43+ text: i18n.tr("Shuffle")
44+ }
45+ MouseArea {
46+ anchors.fill: parent
47+ onClicked: shuffleModel(songArtistModel)
48+ }
49+ }
50+ Button {
51+ id: queueAllRow
52+ height: units.gu(4)
53+ strokeColor: UbuntuColors.green
54+ width: units.gu(15)
55+ Text {
56+ anchors {
57+ centerIn: parent
58+ }
59+ color: "white"
60+ text: i18n.tr("Queue all")
61+ }
62+ MouseArea {
63+ anchors.fill: parent
64+ onClicked: addQueueFromModel(songArtistModel)
65+ }
66+ }
67+ Button {
68+ id: playRow
69+ color: UbuntuColors.green
70+ height: units.gu(4)
71+ text: i18n.tr("Play all")
72+ width: units.gu(15)
73+ MouseArea {
74+ anchors.fill: parent
75+ onClicked: trackClicked(songArtistModel, 0, true)
76+ }
77+ }
78+ }
79+ coverSources: albumStackPage.covers
80+ height: units.gu(30)
81+ bottomColumn: Column {
82+ Label {
83+ id: artistLabel
84+ anchors {
85+ left: parent.left
86+ right: parent.right
87+ }
88+ color: styleMusic.common.music
89+ elide: Text.ElideRight
90+ fontSize: "x-large"
91+ maximumLineCount: 1
92+ objectName: "artistLabel"
93+ text: artist
94+ wrapMode: Text.NoWrap
95+ }
96+
97+ Item {
98+ height: units.gu(1)
99+ width: parent.width
100+ }
101+
102+ Label {
103+ id: artistCount
104+ anchors {
105+ left: parent.left
106+ right: parent.right
107+ }
108+ color: styleMusic.common.subtitle
109+ elide: Text.ElideRight
110+ fontSize: "small"
111+ maximumLineCount: 1
112+ text: i18n.tr("%1 album", "%1 albums", artistsModel.count).arg(artistsModel.count)
113+ }
114+ }
115+
116+ SongsModel {
117+ id: songArtistModel
118+ albumArtist: albumStackPage.artist
119+ store: musicStore
120+ }
121+ }
122+ itemWidth: units.gu(12)
123 model: AlbumsModel {
124 id: artistsModel
125 albumArtist: albumStackPage.artist
126 store: musicStore
127 }
128- width: parent.width
129-
130- Component {
131- id: artistHeaderDelegate
132- ListItem.Standard {
133- id: artistInfo
134- height: units.gu(32)
135- Item {
136- id: artistItem
137- anchors {
138- left: parent.left
139- leftMargin: units.gu(1)
140- verticalCenter: parent.verticalCenter
141- }
142- height: parent.height - units.gu(2)
143- width: height
144- CoverRow {
145- id: artistImage
146- anchors {
147- left: parent.left
148- top: parent.top
149- }
150-
151- count: albumtrackslist.count
152- size: parent.height
153- covers: albumStackPage.covers;
154- spacing: units.gu(4)
155- }
156- Item { // Background so can see text in current state
157- id: albumBg
158- anchors {
159- bottom: parent.bottom
160- left: parent.left
161- right: parent.right
162- }
163- height: units.gu(11)
164- clip: true
165- UbuntuShape{
166- anchors {
167- bottom: parent.bottom
168- left: parent.left
169- right: parent.right
170- }
171- height: artistImage.height
172- radius: "medium"
173- color: styleMusic.common.black
174- opacity: 0.6
175- }
176- }
177- Label {
178- id: albumCount
179- anchors {
180- bottom: parent.bottom
181- bottomMargin: units.gu(8)
182- left: parent.left
183- leftMargin: units.gu(1)
184- right: parent.right
185- rightMargin: units.gu(1)
186- }
187- color: styleMusic.common.white
188- elide: Text.ElideRight
189- text: i18n.tr("%1 album", "%1 albums", albumtrackslist.count).arg(albumtrackslist.count)
190- fontSize: "small"
191- }
192- Label {
193- id: artistLabel
194- objectName: "artistLabel"
195- anchors {
196- left: parent.left
197- leftMargin: units.gu(1)
198- bottom: parent.bottom
199- bottomMargin: units.gu(4.5)
200- right: parent.right
201- rightMargin: units.gu(1)
202- }
203- color: styleMusic.common.white
204- elide: Text.ElideRight
205- text: albumStackPage.artist
206- fontSize: "large"
207- }
208-
209- SongsModel {
210- id: songArtistModel
211- albumArtist: albumStackPage.artist
212- store: musicStore
213- }
214-
215- // Play
216- Rectangle {
217- id: playRow
218- anchors {
219- left: parent.left
220- leftMargin: units.gu(1)
221- bottom: parent.bottom
222- //bottomMargin: units.gu(0)
223- }
224- color: "transparent"
225- height: units.gu(4)
226- width: units.gu(10)
227- Icon {
228- id: playTrack
229- anchors.verticalCenter: parent.verticalCenter
230- name: "media-playback-start"
231- color: styleMusic.common.white
232- height: styleMusic.common.expandedItem
233- width: styleMusic.common.expandedItem
234- }
235- Label {
236- anchors {
237- left: playTrack.right
238- leftMargin: units.gu(0.5)
239- verticalCenter: parent.verticalCenter
240- }
241- fontSize: "small"
242- color: styleMusic.common.white
243- width: parent.width - playTrack.width - units.gu(1)
244- text: i18n.tr("Play all")
245- wrapMode: Text.WordWrap
246- maximumLineCount: 3
247- }
248- MouseArea {
249- anchors.fill: parent
250- onClicked: {
251- trackClicked(songArtistModel, 0, true)
252-
253- // TODO: add links to recent
254- }
255- }
256- }
257-
258- // Queue
259- Rectangle {
260- id: queueAllRow
261- anchors {
262- left: playRow.right
263- leftMargin: units.gu(1)
264- bottom: parent.bottom
265- //bottomMargin: units.gu(1)
266- }
267- color: "transparent"
268- height: units.gu(4)
269- width: units.gu(15)
270- Icon {
271- id: queueAll
272- objectName: "albumpage-queue-all"
273- anchors.verticalCenter: parent.verticalCenter
274- name: "add"
275- color: styleMusic.common.white
276- height: styleMusic.common.expandedItem
277- width: styleMusic.common.expandedItem
278- }
279- Label {
280- anchors {
281- left: queueAll.right
282- leftMargin: units.gu(0.5)
283- verticalCenter: parent.verticalCenter
284- }
285- fontSize: "small"
286- color: styleMusic.common.white
287- width: parent.width - queueAll.width - units.gu(1)
288- text: i18n.tr("Add to queue")
289- wrapMode: Text.WordWrap
290- maximumLineCount: 3
291- }
292- MouseArea {
293- anchors.fill: parent
294- onClicked: {
295- addQueueFromModel(songArtistModel)
296- }
297- }
298- }
299- }
300- }
301- }
302-
303- Component {
304- id: albumTracksDelegate
305-
306-
307- ListItem.Standard {
308- id: albumInfo
309- objectName: "albumsArtistListItem" + index
310- width: parent.width
311- height: units.gu(20)
312-
313- SongsModel {
314- id: songAlbumArtistModel
315- albumArtist: model.artist
316- album: model.title
317- store: musicStore
318- }
319- Repeater {
320- id: songAlbumArtistModelRepeater
321- model: songAlbumArtistModel
322- delegate: Text { text: new Date(model.date).toLocaleString(Qt.locale(),'yyyy'); visible: false }
323- property string year: ""
324- onItemAdded: year = item.text
325- }
326-
327- MouseArea {
328- anchors.fill: parent
329- onClicked: {
330- if (focus == false) {
331- focus = true
332- }
333-
334- songsPage.album = model.title;
335-
336- songsPage.line1 = model.artist
337- songsPage.line2 = model.title
338- songsPage.isAlbum = true
339- songsPage.covers = [{art: model.art}]
340- songsPage.genre = undefined
341- songsPage.title = i18n.tr("Album")
342-
343- mainPageStack.push(songsPage)
344- }
345-
346- // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
347- onPressedChanged: albumImage.pressed = pressed
348- }
349-
350- CoverRow {
351- id: albumImage
352- anchors {
353- top: parent.top
354- left: parent.left
355- margins: units.gu(1)
356- verticalCenter: parent.verticalCenter
357- }
358- count: 1
359- size: parent.height
360- covers: [{art: model.art}]
361- spacing: units.gu(2)
362- }
363-
364- Label {
365- id: albumArtist
366- wrapMode: Text.NoWrap
367- maximumLineCount: 1
368- fontSize: "small"
369- color: styleMusic.common.subtitle
370- anchors.left: albumImage.right
371- anchors.leftMargin: units.gu(1)
372- anchors.top: parent.top
373- anchors.topMargin: units.gu(1.5)
374- anchors.right: parent.right
375- anchors.rightMargin: units.gu(1.5)
376- elide: Text.ElideRight
377- text: model.artist
378- }
379- Label {
380- id: albumLabel
381- wrapMode: Text.NoWrap
382- maximumLineCount: 2
383- fontSize: "medium"
384- color: styleMusic.common.music
385- anchors.left: albumImage.right
386- anchors.leftMargin: units.gu(1)
387- anchors.top: albumArtist.bottom
388- anchors.topMargin: units.gu(0.8)
389- anchors.right: parent.right
390- anchors.rightMargin: units.gu(1.5)
391- elide: Text.ElideRight
392- text: model.title
393- }
394- Label {
395- id: albumYear
396- wrapMode: Text.NoWrap
397- maximumLineCount: 1
398- fontSize: "x-small"
399- color: styleMusic.common.subtitle
400- anchors.left: albumImage.right
401- anchors.leftMargin: units.gu(1)
402- anchors.top: albumLabel.bottom
403- anchors.topMargin: units.gu(2)
404- anchors.right: parent.right
405- anchors.rightMargin: units.gu(1.5)
406- elide: Text.ElideRight
407- text: songAlbumArtistModelRepeater.year + " | " +
408- i18n.tr("%1 song", "%1 songs",
409- songAlbumArtistModelRepeater.count).arg(songAlbumArtistModelRepeater.count)
410- }
411-
412- // Play
413- Rectangle {
414- id: playRow
415- anchors.top: albumYear.bottom
416- anchors.topMargin: units.gu(1)
417- anchors.left: albumImage.right
418- anchors.leftMargin: units.gu(1)
419- color: "transparent"
420- height: units.gu(3)
421- width: units.gu(15)
422- Icon {
423- id: playTrack
424- objectName: "albumpage-playtrack"
425- anchors.verticalCenter: parent.verticalCenter
426- name: "media-playback-start"
427- height: styleMusic.common.expandedItem
428- width: styleMusic.common.expandedItem
429- }
430- Label {
431- anchors.left: playTrack.right
432- anchors.leftMargin: units.gu(0.5)
433- anchors.verticalCenter: parent.verticalCenter
434- fontSize: "small"
435- color: styleMusic.common.subtitle
436- width: parent.width - playTrack.width - units.gu(1)
437- text: i18n.tr("Play all")
438- wrapMode: Text.WordWrap
439- maximumLineCount: 3
440- }
441- MouseArea {
442- anchors.fill: parent
443- onClicked: {
444- Library.addRecent(model.title, artist, "", model.title, "album")
445- mainView.hasRecent = true
446- recentModel.filterRecent()
447- trackClicked(songAlbumArtistModel, 0, true)
448- }
449- }
450- }
451-
452- // Queue
453- Rectangle {
454- id: queueRow
455- anchors.top: playRow.bottom
456- anchors.topMargin: units.gu(1)
457- anchors.left: albumImage.right
458- anchors.leftMargin: units.gu(1)
459- color: "transparent"
460- height: units.gu(3)
461- width: units.gu(15)
462- Icon {
463- id: queueTrack
464- objectName: "albumpage-queuetrack"
465- anchors.verticalCenter: parent.verticalCenter
466- name: "add"
467- height: styleMusic.common.expandedItem
468- width: styleMusic.common.expandedItem
469- }
470- Label {
471- anchors.left: queueTrack.right
472- anchors.leftMargin: units.gu(0.5)
473- anchors.verticalCenter: parent.verticalCenter
474- fontSize: "small"
475- color: styleMusic.common.subtitle
476- width: parent.width - queueTrack.width - units.gu(1)
477- text: i18n.tr("Add to queue")
478- wrapMode: Text.WordWrap
479- maximumLineCount: 3
480- }
481- MouseArea {
482- anchors.fill: parent
483- onClicked: {
484- addQueueFromModel(songAlbumArtistModel)
485- }
486- }
487- }
488+ delegate: Card {
489+ id: albumCard
490+ coverSources: [{art: model.art}]
491+ objectName: "albumsPageGridItem" + index
492+ primaryText: model.title
493+ secondaryText: model.artist
494+
495+ onClicked: {
496+ songsPage.album = model.title;
497+
498+ songsPage.line1 = model.artist
499+ songsPage.line2 = model.title
500+ songsPage.isAlbum = true
501+ songsPage.covers = [{art: model.art}]
502+ songsPage.genre = undefined
503+ songsPage.title = i18n.tr("Album")
504+
505+ mainPageStack.push(songsPage)
506 }
507 }
508 }
509
510=== added file 'common/BlurredHeader.qml'
511--- common/BlurredHeader.qml 1970-01-01 00:00:00 +0000
512+++ common/BlurredHeader.qml 2014-10-16 23:40:22 +0000
513@@ -0,0 +1,73 @@
514+/*
515+ * Copyright (C) 2014
516+ * Andrew Hayzen <ahayzen@gmail.com>
517+ * Victor Thompson <victor.thompson@gmail.com>
518+ *
519+ * This program is free software; you can redistribute it and/or modify
520+ * it under the terms of the GNU General Public License as published by
521+ * the Free Software Foundation; version 3.
522+ *
523+ * This program is distributed in the hope that it will be useful,
524+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
525+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
526+ * GNU General Public License for more details.
527+ *
528+ * You should have received a copy of the GNU General Public License
529+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
530+ */
531+
532+import QtQuick 2.3
533+import Ubuntu.Components 1.1
534+import Ubuntu.Components.ListItems 1.0 as ListItem
535+
536+ListItem.Standard {
537+ id: albumInfo
538+ width: parent.width
539+
540+ property alias bottomColumn: bottomColumnLoader.sourceComponent
541+ property alias coverSources: coversImage.covers
542+ property alias rightColumn: rightColumnLoader.sourceComponent
543+
544+ BlurredBackground {
545+ id: blurredBackground
546+ height: parent.height
547+ art: coversImage.covers.length > 0
548+ ? (coversImage.covers[0].art !== undefined
549+ ? coversImage.covers[0].art
550+ : decodeURIComponent("image://albumart/artist=" + coversImage.covers[0].author + "&album=" + coversImage.covers[0].album))
551+ : Qt.resolvedUrl("../images/music-app-cover@30.png")
552+ }
553+
554+ CoverGrid {
555+ id: coversImage
556+ anchors {
557+ bottomMargin: units.gu(2)
558+ left: parent.left
559+ leftMargin: units.gu(2)
560+ rightMargin: units.gu(2)
561+ top: parent.top
562+ topMargin: units.gu(3)
563+ }
564+ size: units.gu(18)
565+ }
566+
567+ Loader {
568+ id: rightColumnLoader
569+ anchors {
570+ bottom: coversImage.bottom
571+ left: coversImage.right
572+ leftMargin: units.gu(2)
573+ }
574+ }
575+
576+ Loader {
577+ id: bottomColumnLoader
578+ anchors {
579+ left: coversImage.left
580+ right: parent.right
581+ rightMargin: units.gu(2)
582+ top: coversImage.bottom
583+ topMargin: units.gu(1)
584+ }
585+ }
586+}
587
588=== modified file 'common/CardView.qml'
589--- common/CardView.qml 2014-10-13 16:56:55 +0000
590+++ common/CardView.qml 2014-10-16 23:40:22 +0000
591@@ -22,22 +22,40 @@
592 Flickable {
593 anchors {
594 fill: parent
595- margins: units.gu(1)
596 }
597
598 // dont use flow.contentHeight as it is inaccurate due to height of labels
599 // changing as they load
600- contentHeight: flow.childrenRect.height
601+ contentHeight: headerLoader.childrenRect.height + flowContainer.height
602 contentWidth: width
603
604 property alias count: flow.count
605 property alias delegate: flow.delegate
606+ property alias header: headerLoader.sourceComponent
607 property alias model: flow.model
608 property real itemWidth: units.gu(15)
609
610- ColumnFlow {
611- id: flow
612- columns: parseInt(width / itemWidth)
613- width: parent.width
614+ Loader {
615+ id: headerLoader
616+ width: parent.width
617+ }
618+
619+ Item {
620+ id: flowContainer
621+ anchors {
622+ top: headerLoader.bottom
623+ }
624+ height: flow.childrenRect.height + flow.anchors.margins * 2
625+ width: parent.width
626+
627+ ColumnFlow {
628+ id: flow
629+ anchors {
630+ fill: parent
631+ margins: units.gu(1)
632+ }
633+
634+ columns: parseInt(width / itemWidth)
635+ }
636 }
637 }
638
639=== modified file 'common/SongsPage.qml'
640--- common/SongsPage.qml 2014-10-14 00:25:48 +0000
641+++ common/SongsPage.qml 2014-10-16 23:40:22 +0000
642@@ -99,182 +99,139 @@
643 model: isAlbum ? songsModel : albumTracksModel.model
644 objectName: "songspage-listview"
645 width: parent.width
646- header: ListItem.Standard {
647- id: albumInfo
648- height: albumArtist.visible ? units.gu(33) : units.gu(30)
649-
650- BlurredBackground {
651- id: blurredBackground
652- height: parent.height
653- art: coversImage.covers.length > 0
654- ? (coversImage.covers[0].art !== undefined
655- ? coversImage.covers[0].art
656- : decodeURIComponent("image://albumart/artist=" + coversImage.covers[0].author + "&album=" + coversImage.covers[0].album))
657- : Qt.resolvedUrl("../images/music-app-cover@30.png")
658- }
659-
660- CoverGrid {
661- id: coversImage
662- anchors {
663- top: parent.top
664- left: parent.left
665- topMargin: units.gu(3)
666- bottomMargin: units.gu(2)
667- leftMargin: units.gu(2)
668- rightMargin: units.gu(2)
669- }
670- covers: songStackPage.covers
671- size: units.gu(18)
672- }
673-
674- Label {
675- id: albumLabel
676- wrapMode: Text.NoWrap
677- maximumLineCount: 1
678- fontSize: "x-large"
679- color: styleMusic.common.music
680- anchors {
681- top: coversImage.bottom
682- topMargin: units.gu(1)
683- left: coversImage.left
684- right: parent.right
685- rightMargin: units.gu(2)
686- }
687- elide: Text.ElideRight
688- text: line2
689- }
690-
691- Label {
692- id: albumArtist
693- objectName: "songsPageHeaderAlbumArtist"
694- wrapMode: Text.NoWrap
695- maximumLineCount: 1
696- fontSize: "small"
697- color: styleMusic.common.subtitle
698- visible: text !== i18n.tr("Playlist") &&
699- text !== i18n.tr("Genre")
700- anchors {
701- top: albumLabel.bottom
702- topMargin: units.gu(0.75)
703- left: coversImage.left
704- right: parent.right
705- rightMargin: units.gu(2)
706- }
707- elide: Text.ElideRight
708- text: line1
709- }
710-
711- Label {
712- id: albumYear
713- wrapMode: Text.NoWrap
714- maximumLineCount: 1
715- fontSize: "small"
716- color: styleMusic.common.subtitle
717- anchors {
718- top: albumArtist.visible ? albumArtist.bottom
719- : albumLabel.bottom
720- topMargin: units.gu(1)
721- left: coversImage.left
722- right: parent.right
723- rightMargin: units.gu(2)
724- }
725- elide: Text.ElideRight
726- text: isAlbum && line1 !== i18n.tr("Genre") ? year + " | " + i18n.tr("%1 song", "%1 songs", albumtrackslist.count).arg(albumtrackslist.count)
727- : i18n.tr("%1 song", "%1 songs", albumtrackslist.count).arg(albumtrackslist.count)
728-
729- }
730-
731- // Shuffle
732- Button {
733- id: shuffleRow
734- anchors {
735- bottom: queueAllRow.top
736- bottomMargin: units.gu(2)
737- left: coversImage.right
738- leftMargin: units.gu(2)
739- }
740- strokeColor: UbuntuColors.green
741- height: units.gu(4)
742- width: units.gu(15)
743- Text {
744- anchors {
745- centerIn: parent
746- }
747- color: "white"
748- text: i18n.tr("Shuffle")
749- }
750- MouseArea {
751- anchors.fill: parent
752- onClicked: {
753- shuffleModel(albumtrackslist.model) // play track
754-
755- if (isAlbum && songStackPage.line1 !== i18n.tr("Genre")) {
756- Library.addRecent(songStackPage.line2, songStackPage.line1, songStackPage.covers[0], songStackPage.line2, "album")
757- mainView.hasRecent = true
758- recentModel.filterRecent()
759- } else if (songStackPage.line1 === i18n.tr("Playlist")) {
760- Library.addRecent(songStackPage.line2, "Playlist", songStackPage.covers[0], songStackPage.line2, "playlist")
761- mainView.hasRecent = true
762- recentModel.filterRecent()
763- }
764- }
765- }
766- }
767-
768- // Queue
769- Button {
770- id: queueAllRow
771- anchors {
772- bottom: playRow.top
773- bottomMargin: units.gu(2)
774- left: coversImage.right
775- leftMargin: units.gu(2)
776- }
777- strokeColor: UbuntuColors.green
778- height: units.gu(4)
779- width: units.gu(15)
780- Text {
781- anchors {
782- centerIn: parent
783- }
784- color: "white"
785- text: i18n.tr("Queue all")
786- }
787- MouseArea {
788- anchors.fill: parent
789- onClicked: {
790- addQueueFromModel(albumtrackslist.model)
791- }
792- }
793- }
794-
795- // Play
796- Button {
797- id: playRow
798- anchors {
799- bottom: coversImage.bottom
800- left: coversImage.right
801- leftMargin: units.gu(2)
802- }
803- color: UbuntuColors.green
804- height: units.gu(4)
805- width: units.gu(15)
806- text: i18n.tr("Play all")
807- MouseArea {
808- anchors.fill: parent
809- onClicked: {
810- trackClicked(albumtrackslist.model, 0) // play track
811-
812- if (isAlbum && songStackPage.line1 !== i18n.tr("Genre")) {
813- Library.addRecent(songStackPage.line2, songStackPage.line1, songStackPage.covers[0], songStackPage.line2, "album")
814- mainView.hasRecent = true
815- recentModel.filterRecent()
816- } else if (songStackPage.line1 === i18n.tr("Playlist")) {
817- Library.addRecent(songStackPage.line2, "Playlist", songStackPage.covers[0], songStackPage.line2, "playlist")
818- mainView.hasRecent = true
819- recentModel.filterRecent()
820- }
821- }
822+ header: BlurredHeader {
823+ rightColumn: Column {
824+ spacing: units.gu(2)
825+ Button {
826+ id: shuffleRow
827+ height: units.gu(4)
828+ strokeColor: UbuntuColors.green
829+ width: units.gu(15)
830+ Text {
831+ anchors {
832+ centerIn: parent
833+ }
834+ color: "white"
835+ text: i18n.tr("Shuffle")
836+ }
837+ MouseArea {
838+ anchors.fill: parent
839+ onClicked: {
840+ shuffleModel(albumtrackslist.model) // play track
841+
842+ if (isAlbum && songStackPage.line1 !== i18n.tr("Genre")) {
843+ Library.addRecent(songStackPage.line2, songStackPage.line1, songStackPage.covers[0], songStackPage.line2, "album")
844+ mainView.hasRecent = true
845+ recentModel.filterRecent()
846+ } else if (songStackPage.line1 === i18n.tr("Playlist")) {
847+ Library.addRecent(songStackPage.line2, "Playlist", songStackPage.covers[0], songStackPage.line2, "playlist")
848+ mainView.hasRecent = true
849+ recentModel.filterRecent()
850+ }
851+ }
852+ }
853+ }
854+ Button {
855+ id: queueAllRow
856+ height: units.gu(4)
857+ strokeColor: UbuntuColors.green
858+ width: units.gu(15)
859+ Text {
860+ anchors {
861+ centerIn: parent
862+ }
863+ color: "white"
864+ text: i18n.tr("Queue all")
865+ }
866+ MouseArea {
867+ anchors.fill: parent
868+ onClicked: addQueueFromModel(albumtrackslist.model)
869+ }
870+ }
871+ Button {
872+ id: playRow
873+ color: UbuntuColors.green
874+ height: units.gu(4)
875+ text: i18n.tr("Play all")
876+ width: units.gu(15)
877+ MouseArea {
878+ anchors.fill: parent
879+ onClicked: {
880+ trackClicked(albumtrackslist.model, 0) // play track
881+
882+ if (isAlbum && songStackPage.line1 !== i18n.tr("Genre")) {
883+ Library.addRecent(songStackPage.line2, songStackPage.line1, songStackPage.covers[0], songStackPage.line2, "album")
884+ mainView.hasRecent = true
885+ recentModel.filterRecent()
886+ } else if (songStackPage.line1 === i18n.tr("Playlist")) {
887+ Library.addRecent(songStackPage.line2, "Playlist", songStackPage.covers[0], songStackPage.line2, "playlist")
888+ mainView.hasRecent = true
889+ recentModel.filterRecent()
890+ }
891+ }
892+ }
893+ }
894+ }
895+ coverSources: songStackPage.covers
896+ height: songStackPage.line1 !== i18n.tr("Playlist") &&
897+ songStackPage.line1 !== i18n.tr("Genre") ?
898+ units.gu(33) : units.gu(30)
899+ bottomColumn: Column {
900+ Label {
901+ id: albumLabel
902+ anchors {
903+ left: parent.left
904+ right: parent.right
905+ }
906+ color: styleMusic.common.music
907+ elide: Text.ElideRight
908+ fontSize: "x-large"
909+ maximumLineCount: 1
910+ text: line2
911+ wrapMode: Text.NoWrap
912+ }
913+
914+ Item {
915+ height: units.gu(0.75)
916+ width: parent.width
917+ visible: albumArtist.visible
918+ }
919+
920+ Label {
921+ id: albumArtist
922+ anchors {
923+ left: parent.left
924+ right: parent.right
925+ }
926+ color: styleMusic.common.subtitle
927+ elide: Text.ElideRight
928+ fontSize: "small"
929+ maximumLineCount: 1
930+ objectName: "songsPageHeaderAlbumArtist"
931+ text: line1
932+ visible: text !== i18n.tr("Playlist") &&
933+ text !== i18n.tr("Genre")
934+ wrapMode: Text.NoWrap
935+ }
936+
937+ Item {
938+ height: units.gu(1)
939+ width: parent.width
940+ }
941+
942+ Label {
943+ id: albumYear
944+ anchors {
945+ left: parent.left
946+ right: parent.right
947+ }
948+ color: styleMusic.common.subtitle
949+ elide: Text.ElideRight
950+ fontSize: "small"
951+ maximumLineCount: 1
952+ text: isAlbum && line1 !== i18n.tr("Genre") ? year + " | " + i18n.tr("%1 song", "%1 songs", albumtrackslist.count).arg(albumtrackslist.count)
953+ : i18n.tr("%1 song", "%1 songs", albumtrackslist.count).arg(albumtrackslist.count)
954+ wrapMode: Text.NoWrap
955 }
956 }
957 }
958
959=== modified file 'po/com.ubuntu.music.pot'
960--- po/com.ubuntu.music.pot 2014-10-14 00:06:59 +0000
961+++ po/com.ubuntu.music.pot 2014-10-16 23:40:22 +0000
962@@ -8,7 +8,7 @@
963 msgstr ""
964 "Project-Id-Version: music-app\n"
965 "Report-Msgid-Bugs-To: \n"
966-"POT-Creation-Date: 2014-10-14 01:06+0100\n"
967+"POT-Creation-Date: 2014-10-14 16:45+0100\n"
968 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
969 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
970 "Language-Team: LANGUAGE <LL@li.org>\n"
971@@ -59,7 +59,7 @@
972 msgstr ""
973
974 #: ../MusicAlbums.qml:57 ../MusicStart.qml:200 ../MusicStart.qml:454
975-#: ../common/AlbumsPage.qml:262
976+#: ../common/AlbumsPage.qml:146
977 msgid "Album"
978 msgstr ""
979
980@@ -86,8 +86,8 @@
981 msgstr ""
982
983 #: ../MusicPlaylists.qml:61 ../MusicStart.qml:371
984-#: ../MusicaddtoPlaylist.qml:105 ../common/AlbumsPage.qml:329
985-#: ../common/SongsPage.qml:184 ../common/SongsPage.qml:185
986+#: ../MusicaddtoPlaylist.qml:105 ../common/SongsPage.qml:220
987+#: ../common/SongsPage.qml:221
988 #, qt-format
989 msgid "%1 song"
990 msgid_plural "%1 songs"
991@@ -96,9 +96,10 @@
992
993 #: ../MusicPlaylists.qml:66 ../MusicPlaylists.qml:70 ../MusicStart.qml:118
994 #: ../MusicStart.qml:200 ../common/SongsPage.qml:47
995-#: ../common/SongsPage.qml:156 ../common/SongsPage.qml:217
996-#: ../common/SongsPage.qml:274 ../common/SongsPage.qml:296
997-#: ../common/SongsPage.qml:298 ../common/SongsPage.qml:316
998+#: ../common/SongsPage.qml:126 ../common/SongsPage.qml:166
999+#: ../common/SongsPage.qml:176 ../common/SongsPage.qml:204
1000+#: ../common/SongsPage.qml:239 ../common/SongsPage.qml:241
1001+#: ../common/SongsPage.qml:259
1002 msgid "Playlist"
1003 msgstr ""
1004
1005@@ -210,9 +211,10 @@
1006 msgid "Genres"
1007 msgstr ""
1008
1009-#: ../MusicStart.qml:316 ../MusicStart.qml:318 ../common/SongsPage.qml:157
1010-#: ../common/SongsPage.qml:184 ../common/SongsPage.qml:213
1011-#: ../common/SongsPage.qml:270 ../common/SongsPage.qml:312
1012+#: ../MusicStart.qml:316 ../MusicStart.qml:318 ../common/SongsPage.qml:122
1013+#: ../common/SongsPage.qml:162 ../common/SongsPage.qml:177
1014+#: ../common/SongsPage.qml:205 ../common/SongsPage.qml:220
1015+#: ../common/SongsPage.qml:255
1016 msgid "Genre"
1017 msgstr ""
1018
1019@@ -232,23 +234,25 @@
1020 msgid "New playlist"
1021 msgstr ""
1022
1023-#: ../common/AlbumsPage.qml:110
1024+#: ../common/AlbumsPage.qml:55 ../common/SongsPage.qml:115
1025+msgid "Shuffle"
1026+msgstr ""
1027+
1028+#: ../common/AlbumsPage.qml:72 ../common/SongsPage.qml:144
1029+msgid "Queue all"
1030+msgstr ""
1031+
1032+#: ../common/AlbumsPage.qml:83 ../common/SongsPage.qml:155
1033+msgid "Play all"
1034+msgstr ""
1035+
1036+#: ../common/AlbumsPage.qml:115
1037 #, qt-format
1038 msgid "%1 album"
1039 msgid_plural "%1 albums"
1040 msgstr[0] ""
1041 msgstr[1] ""
1042
1043-#: ../common/AlbumsPage.qml:165 ../common/AlbumsPage.qml:358
1044-#: ../common/SongsPage.qml:264
1045-msgid "Play all"
1046-msgstr ""
1047-
1048-#: ../common/AlbumsPage.qml:209 ../common/AlbumsPage.qml:398
1049-#: ../music-app.qml:877
1050-msgid "Add to queue"
1051-msgstr ""
1052-
1053 #: ../common/ListItemActions/AddToPlaylist.qml:25 ../music-app.qml:891
1054 msgid "Add to playlist"
1055 msgstr ""
1056@@ -257,7 +261,7 @@
1057 msgid "Add to Queue"
1058 msgstr ""
1059
1060-#: ../common/ListItemActions/Remove.qml:27 ../common/SongsPage.qml:446
1061+#: ../common/ListItemActions/Remove.qml:27 ../common/SongsPage.qml:389
1062 msgid "Remove"
1063 msgstr ""
1064
1065@@ -265,46 +269,38 @@
1066 msgid "Loading..."
1067 msgstr ""
1068
1069-#: ../common/SongsPage.qml:206
1070-msgid "Shuffle"
1071-msgstr ""
1072-
1073-#: ../common/SongsPage.qml:243
1074-msgid "Queue all"
1075-msgstr ""
1076-
1077 #. TRANSLATORS: this is a title of a dialog with a prompt to rename a playlist
1078-#: ../common/SongsPage.qml:384
1079+#: ../common/SongsPage.qml:327
1080 msgid "Change name"
1081 msgstr ""
1082
1083-#: ../common/SongsPage.qml:385
1084+#: ../common/SongsPage.qml:328
1085 msgid "Enter the new name of the playlist."
1086 msgstr ""
1087
1088-#: ../common/SongsPage.qml:402
1089+#: ../common/SongsPage.qml:345
1090 msgid "Change"
1091 msgstr ""
1092
1093-#: ../common/SongsPage.qml:418 ../music-app.qml:945
1094+#: ../common/SongsPage.qml:361 ../music-app.qml:945
1095 msgid "Playlist already exists"
1096 msgstr ""
1097
1098-#: ../common/SongsPage.qml:422 ../music-app.qml:950
1099+#: ../common/SongsPage.qml:365 ../music-app.qml:950
1100 msgid "Please type in a name."
1101 msgstr ""
1102
1103-#: ../common/SongsPage.qml:427 ../common/SongsPage.qml:460
1104+#: ../common/SongsPage.qml:370 ../common/SongsPage.qml:403
1105 #: ../music-app.qml:486 ../music-app.qml:956
1106 msgid "Cancel"
1107 msgstr ""
1108
1109 #. TRANSLATORS: this is a title of a dialog with a prompt to delete a playlist
1110-#: ../common/SongsPage.qml:440
1111+#: ../common/SongsPage.qml:383
1112 msgid "Are you sure?"
1113 msgstr ""
1114
1115-#: ../common/SongsPage.qml:441
1116+#: ../common/SongsPage.qml:384
1117 msgid "This will delete your playlist."
1118 msgstr ""
1119
1120@@ -420,6 +416,10 @@
1121 msgid "Debug: "
1122 msgstr ""
1123
1124+#: ../music-app.qml:877
1125+msgid "Add to queue"
1126+msgstr ""
1127+
1128 #: ../music-app.qml:914
1129 msgid "New Playlist"
1130 msgstr ""
1131
1132=== modified file 'tests/autopilot/music_app/__init__.py'
1133--- tests/autopilot/music_app/__init__.py 2014-10-13 16:56:55 +0000
1134+++ tests/autopilot/music_app/__init__.py 2014-10-16 23:40:22 +0000
1135@@ -310,8 +310,8 @@
1136
1137 @click_object
1138 def click_artist(self, i):
1139- return self.wait_select_single("Standard",
1140- objectName="albumsArtistListItem"
1141+ return self.wait_select_single("Card",
1142+ objectName="albumsPageGridItem"
1143 + str(i))
1144
1145 def get_artist(self):

Subscribers

People subscribed via source and target branches