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
1=== modified file 'MusicNowPlaying.qml'
2--- MusicNowPlaying.qml 2014-10-22 18:17:49 +0000
3+++ MusicNowPlaying.qml 2014-10-22 19:53:40 +0000
4@@ -595,9 +595,7 @@
5
6 MusicRow {
7 id: musicRow
8- covers: [{art: model.art, album: model.album, author: model.author}]
9- showCovers: false
10- coverSize: units.gu(6)
11+ height: parent.height
12 column: Column {
13 Label {
14 id: trackTitle
15
16=== modified file 'MusicTracks.qml'
17--- MusicTracks.qml 2014-10-22 17:46:50 +0000
18+++ MusicTracks.qml 2014-10-22 19:53:40 +0000
19@@ -163,10 +163,10 @@
20
21 MusicRow {
22 id: musicRow
23- anchors.verticalCenter: parent.verticalCenter
24- covers: [{art: model.art}]
25- coverSize: units.gu(6)
26- spacing: units.gu(2)
27+ anchors {
28+ verticalCenter: parent.verticalCenter
29+ }
30+ imageSource: {"art": model.art}
31 column: Column {
32 Label {
33 id: trackTitle
34
35=== modified file 'common/ListItemWithActions.qml'
36--- common/ListItemWithActions.qml 2014-10-22 17:37:45 +0000
37+++ common/ListItemWithActions.qml 2014-10-22 19:53:40 +0000
38@@ -337,7 +337,7 @@
39 ]
40
41 height: defaultHeight
42- clip: height !== defaultHeight
43+ //clip: height !== defaultHeight // CUSTOM
44
45 Rectangle {
46 id: leftActionView
47@@ -352,6 +352,7 @@
48 color: UbuntuColors.red
49
50 Icon {
51+ id: leftActionIcon
52 anchors {
53 centerIn: parent
54 horizontalCenterOffset: actionThreshold / 2
55
56=== modified file 'common/MusicRow.qml'
57--- common/MusicRow.qml 2014-10-22 18:05:11 +0000
58+++ common/MusicRow.qml 2014-10-22 19:53:40 +0000
59@@ -28,36 +28,47 @@
60 right: parent.right
61 rightMargin: units.gu(2)
62 }
63+ height: units.gu(7)
64
65- property alias covers: coverGrid.covers
66- property bool showCovers: true
67 property alias column: columnComponent.sourceComponent
68 property real coverSize: styleMusic.common.albumSize
69-
70- spacing: units.gu(1)
71-
72- CoverGrid {
73- id: coverGrid
74+ property var imageSource
75+
76+ spacing: units.gu(2)
77+
78+ Image {
79+ id: image
80 anchors {
81 verticalCenter: parent.verticalCenter
82- topMargin: units.gu(0.5)
83- bottomMargin: units.gu(0.5)
84- leftMargin: units.gu(2)
85- }
86- covers: []
87- size: coverSize
88- visible: showCovers
89+ }
90+ asynchronous: true
91+ fillMode: Image.PreserveAspectCrop
92+ height: width
93+ source: imageSource !== undefined && imageSource !== ""
94+ ? (imageSource.art !== undefined
95+ ? imageSource.art
96+ : "image://albumart/artist=" + imageSource.author + "&album=" + imageSource.album)
97+ : ""
98+ sourceSize.height: height
99+ sourceSize.width: width
100+ width: units.gu(6)
101+
102+ onStatusChanged: {
103+ if (status === Image.Error) {
104+ source = Qt.resolvedUrl("../images/music-app-cover@30.png")
105+ }
106+ }
107+ visible: imageSource !== undefined
108 }
109
110 Loader {
111 id: columnComponent
112 anchors {
113- top: parent.top
114- topMargin: units.gu(1)
115+ verticalCenter: parent.verticalCenter
116 }
117 asynchronous: true
118- width: !showCovers ? parent.width - parent.spacing
119- : parent.width - coverGrid.width - parent.spacing
120+ width: imageSource === undefined ? parent.width - parent.spacing
121+ : parent.width - image.width - parent.spacing
122
123 onSourceComponentChanged: {
124 for (var i=0; i < item.children.length; i++) {
125
126=== modified file 'common/SongsPage.qml'
127--- common/SongsPage.qml 2014-10-22 16:23:35 +0000
128+++ common/SongsPage.qml 2014-10-22 19:53:40 +0000
129@@ -388,8 +388,7 @@
130
131 MusicRow {
132 id: musicRow
133- covers: []
134- showCovers: false
135+ height: parent.height
136 column: Column {
137 Label {
138 id: trackTitle

Subscribers

People subscribed via source and target branches