Merge lp:~ahayzen/music-app/remix-perf-003 into lp:music-app/remix

Proposed by Andrew Hayzen
Status: Merged
Approved by: Victor Thompson
Approved revision: 694
Merged at revision: 697
Proposed branch: lp:~ahayzen/music-app/remix-perf-003
Merge into: lp:music-app/remix
Diff against target: 138 lines (+37/-28)
5 files modified
MusicNowPlaying.qml (+1/-3)
MusicTracks.qml (+4/-4)
common/ListItemWithActions.qml (+2/-1)
common/MusicRow.qml (+29/-18)
common/SongsPage.qml (+1/-2)
To merge this branch: bzr merge lp:~ahayzen/music-app/remix-perf-003
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Victor Thompson Approve
Review via email: mp+239288@code.launchpad.net

Commit message

* Optimise MusicRow.qml by using Image rather than CoverGrid (as there will only ever be one image)

Description of the change

* Optimise MusicRow.qml by using Image rather than CoverGrid (as there will only ever be one image)

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)
Revision history for this message
Victor Thompson (vthompson) wrote :

LGTM!

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'MusicNowPlaying.qml'
--- MusicNowPlaying.qml 2014-10-22 18:17:49 +0000
+++ MusicNowPlaying.qml 2014-10-22 19:53:40 +0000
@@ -595,9 +595,7 @@
595595
596 MusicRow {596 MusicRow {
597 id: musicRow597 id: musicRow
598 covers: [{art: model.art, album: model.album, author: model.author}]598 height: parent.height
599 showCovers: false
600 coverSize: units.gu(6)
601 column: Column {599 column: Column {
602 Label {600 Label {
603 id: trackTitle601 id: trackTitle
604602
=== modified file 'MusicTracks.qml'
--- MusicTracks.qml 2014-10-22 17:46:50 +0000
+++ MusicTracks.qml 2014-10-22 19:53:40 +0000
@@ -163,10 +163,10 @@
163163
164 MusicRow {164 MusicRow {
165 id: musicRow165 id: musicRow
166 anchors.verticalCenter: parent.verticalCenter166 anchors {
167 covers: [{art: model.art}]167 verticalCenter: parent.verticalCenter
168 coverSize: units.gu(6)168 }
169 spacing: units.gu(2)169 imageSource: {"art": model.art}
170 column: Column {170 column: Column {
171 Label {171 Label {
172 id: trackTitle172 id: trackTitle
173173
=== modified file 'common/ListItemWithActions.qml'
--- common/ListItemWithActions.qml 2014-10-22 17:37:45 +0000
+++ common/ListItemWithActions.qml 2014-10-22 19:53:40 +0000
@@ -337,7 +337,7 @@
337 ]337 ]
338338
339 height: defaultHeight339 height: defaultHeight
340 clip: height !== defaultHeight340 //clip: height !== defaultHeight // CUSTOM
341341
342 Rectangle {342 Rectangle {
343 id: leftActionView343 id: leftActionView
@@ -352,6 +352,7 @@
352 color: UbuntuColors.red352 color: UbuntuColors.red
353353
354 Icon {354 Icon {
355 id: leftActionIcon
355 anchors {356 anchors {
356 centerIn: parent357 centerIn: parent
357 horizontalCenterOffset: actionThreshold / 2358 horizontalCenterOffset: actionThreshold / 2
358359
=== modified file 'common/MusicRow.qml'
--- common/MusicRow.qml 2014-10-22 18:05:11 +0000
+++ common/MusicRow.qml 2014-10-22 19:53:40 +0000
@@ -28,36 +28,47 @@
28 right: parent.right28 right: parent.right
29 rightMargin: units.gu(2)29 rightMargin: units.gu(2)
30 }30 }
31 height: units.gu(7)
3132
32 property alias covers: coverGrid.covers
33 property bool showCovers: true
34 property alias column: columnComponent.sourceComponent33 property alias column: columnComponent.sourceComponent
35 property real coverSize: styleMusic.common.albumSize34 property real coverSize: styleMusic.common.albumSize
3635 property var imageSource
37 spacing: units.gu(1)36
3837 spacing: units.gu(2)
39 CoverGrid {38
40 id: coverGrid39 Image {
40 id: image
41 anchors {41 anchors {
42 verticalCenter: parent.verticalCenter42 verticalCenter: parent.verticalCenter
43 topMargin: units.gu(0.5)43 }
44 bottomMargin: units.gu(0.5)44 asynchronous: true
45 leftMargin: units.gu(2)45 fillMode: Image.PreserveAspectCrop
46 }46 height: width
47 covers: []47 source: imageSource !== undefined && imageSource !== ""
48 size: coverSize48 ? (imageSource.art !== undefined
49 visible: showCovers49 ? imageSource.art
50 : "image://albumart/artist=" + imageSource.author + "&album=" + imageSource.album)
51 : ""
52 sourceSize.height: height
53 sourceSize.width: width
54 width: units.gu(6)
55
56 onStatusChanged: {
57 if (status === Image.Error) {
58 source = Qt.resolvedUrl("../images/music-app-cover@30.png")
59 }
60 }
61 visible: imageSource !== undefined
50 }62 }
5163
52 Loader {64 Loader {
53 id: columnComponent65 id: columnComponent
54 anchors {66 anchors {
55 top: parent.top67 verticalCenter: parent.verticalCenter
56 topMargin: units.gu(1)
57 }68 }
58 asynchronous: true69 asynchronous: true
59 width: !showCovers ? parent.width - parent.spacing70 width: imageSource === undefined ? parent.width - parent.spacing
60 : parent.width - coverGrid.width - parent.spacing71 : parent.width - image.width - parent.spacing
6172
62 onSourceComponentChanged: {73 onSourceComponentChanged: {
63 for (var i=0; i < item.children.length; i++) {74 for (var i=0; i < item.children.length; i++) {
6475
=== modified file 'common/SongsPage.qml'
--- common/SongsPage.qml 2014-10-22 16:23:35 +0000
+++ common/SongsPage.qml 2014-10-22 19:53:40 +0000
@@ -388,8 +388,7 @@
388388
389 MusicRow {389 MusicRow {
390 id: musicRow390 id: musicRow
391 covers: []391 height: parent.height
392 showCovers: false
393 column: Column {392 column: Column {
394 Label {393 Label {
395 id: trackTitle394 id: trackTitle

Subscribers

People subscribed via source and target branches