Merge lp:~ahayzen/music-app/remix-image-size-fix into lp:music-app/remix

Proposed by Andrew Hayzen
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 680
Merged at revision: 678
Proposed branch: lp:~ahayzen/music-app/remix-image-size-fix
Merge into: lp:music-app/remix
Diff against target: 192 lines (+33/-56)
7 files modified
MusicNowPlaying.qml (+7/-11)
MusicToolbar.qml (+10/-20)
common/BlurredBackground.qml (+1/-5)
common/BlurredHeader.qml (+1/-5)
common/CoverGrid.qml (+8/-1)
common/CoverRow.qml (+2/-0)
common/MusicRow.qml (+4/-14)
To merge this branch: bzr merge lp:~ahayzen/music-app/remix-image-size-fix
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Victor Thompson Approve
Review via email: mp+238883@code.launchpad.net

Commit message

* Set sourceSize of images

Description of the change

* Set sourceSize of images

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: Approve (continuous-integration)
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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

The code here looks great. Currently there's a portion of CoverGrid that introduces the possibility for the app to set the source to "undefined" which causes a QML error to be logged. Perhaps we should investigate all error output in the console log in the future.

review: Approve
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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
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-13 12:36:59 +0000
3+++ MusicNowPlaying.qml 2014-10-20 15:58:04 +0000
4@@ -89,19 +89,15 @@
5 anchors.top: parent.top
6 anchors.topMargin: mainView.header.height
7 height: units.gu(27)
8- art: albumImage.source
9+ art: albumImage.firstSource
10
11- Image {
12+ CoverGrid {
13 id: albumImage
14- anchors.centerIn: parent
15- width: units.gu(18)
16- height: width
17- smooth: true
18- source: player.currentMetaArt === "" ?
19- decodeURIComponent("image://albumart/artist=" +
20- player.currentMetaArtist +
21- "&album=" + player.currentMetaAlbum)
22- : player.currentMetaArt
23+ anchors {
24+ centerIn: parent
25+ }
26+ covers: [{art: player.currentMetaArt, author: player.currentMetaArtist, album: player.currentMetaAlbum}]
27+ size: units.gu(18)
28 }
29 }
30
31
32=== modified file 'MusicToolbar.qml'
33--- MusicToolbar.qml 2014-10-08 18:33:38 +0000
34+++ MusicToolbar.qml 2014-10-20 15:58:04 +0000
35@@ -22,6 +22,7 @@
36 import QtMultimedia 5.0
37 import Ubuntu.Components 1.1
38 import Ubuntu.Components.Popups 1.0
39+import "common"
40 import "settings.js" as Settings
41
42 Item {
43@@ -201,26 +202,15 @@
44 color: "transparent"
45
46 /* Album art in player controls */
47- Image {
48- id: playerControlsImage
49- anchors {
50- bottom: parent.bottom
51- left: parent.left
52- top: parent.top
53- }
54- smooth: true
55- source: player.currentMetaArt === "" ?
56- decodeURIComponent("image://albumart/artist=" +
57- player.currentMetaArtist +
58- "&album=" + player.currentMetaAlbum)
59- : player.currentMetaArt
60- width: parent.height
61-
62- onStatusChanged: {
63- if (status === Image.Error) {
64- source = Qt.resolvedUrl("../images/music-app-cover@30.png")
65- }
66- }
67+ CoverGrid {
68+ id: playerControlsImage
69+ anchors {
70+ bottom: parent.bottom
71+ left: parent.left
72+ top: parent.top
73+ }
74+ covers: [{art: player.currentMetaArt, author: player.currentMetaArtist, album: player.currentMetaArt}]
75+ size: parent.height
76 }
77
78 /* Column of meta labels */
79
80=== modified file 'common/BlurredBackground.qml'
81--- common/BlurredBackground.qml 2014-10-04 00:56:45 +0000
82+++ common/BlurredBackground.qml 2014-10-20 15:58:04 +0000
83@@ -42,12 +42,8 @@
84 height: parent.height
85 width: Math.max(parent.height, parent.width)
86 visible: false
87- onStatusChanged: {
88- if (status === Image.Error) {
89- source = Qt.resolvedUrl("../images/music-app-cover@30.png")
90- }
91- }
92 }
93+
94 // the blur
95 FastBlur {
96 id: backgroundBlur
97
98=== modified file 'common/BlurredHeader.qml'
99--- common/BlurredHeader.qml 2014-10-16 23:36:00 +0000
100+++ common/BlurredHeader.qml 2014-10-20 15:58:04 +0000
101@@ -31,11 +31,7 @@
102 BlurredBackground {
103 id: blurredBackground
104 height: parent.height
105- art: coversImage.covers.length > 0
106- ? (coversImage.covers[0].art !== undefined
107- ? coversImage.covers[0].art
108- : decodeURIComponent("image://albumart/artist=" + coversImage.covers[0].author + "&album=" + coversImage.covers[0].album))
109- : Qt.resolvedUrl("../images/music-app-cover@30.png")
110+ art: coversImage.firstSource
111 }
112
113 CoverGrid {
114
115=== modified file 'common/CoverGrid.qml'
116--- common/CoverGrid.qml 2014-10-13 16:32:09 +0000
117+++ common/CoverGrid.qml 2014-10-20 15:58:04 +0000
118@@ -32,6 +32,8 @@
119 // Property to set the size of the cover image
120 property int size
121
122+ property string firstSource
123+
124 onCoversChanged: {
125 if (covers !== undefined) {
126 while (covers.length > 4) { // remove any covers after 4
127@@ -58,10 +60,15 @@
128 ? (coverGrid.covers[index].art !== undefined
129 ? coverGrid.covers[index].art
130 : "image://albumart/artist=" + coverGrid.covers[index].author + "&album=" + coverGrid.covers[index].album)
131- : Qt.resolvedUrl("../images/music-app-cover@30.png")
132+ : undefined
133+ sourceSize.height: height
134+ sourceSize.width: width
135+
136 onStatusChanged: {
137 if (status === Image.Error) {
138 source = Qt.resolvedUrl("../images/music-app-cover@30.png")
139+ } else if (status === Image.Ready && index === 0) {
140+ firstSource = source
141 }
142 }
143 }
144
145=== modified file 'common/CoverRow.qml'
146--- common/CoverRow.qml 2014-09-20 15:41:33 +0000
147+++ common/CoverRow.qml 2014-10-20 15:58:04 +0000
148@@ -63,6 +63,8 @@
149 ? coverRow.covers[index].art
150 : "image://albumart/artist=" + coverRow.covers[index].author + "&album=" + coverRow.covers[index].album)
151 : Qt.resolvedUrl("../images/music-app-cover@30.png")
152+ sourceSize.height: height
153+ sourceSize.width: width
154 onStatusChanged: {
155 if (status === Image.Error) {
156 source = Qt.resolvedUrl("../images/music-app-cover@30.png")
157
158=== modified file 'common/MusicRow.qml'
159--- common/MusicRow.qml 2014-10-09 00:31:51 +0000
160+++ common/MusicRow.qml 2014-10-20 15:58:04 +0000
161@@ -50,27 +50,17 @@
162 size: coverSize
163 }
164
165- Image {
166+ CoverGrid {
167 id: coverSquare
168- visible: showCovers && isSquare
169- width: coverSize
170- height: coverSize
171 anchors {
172 verticalCenter: parent.verticalCenter
173 topMargin: units.gu(0.5)
174 bottomMargin: units.gu(0.5)
175 leftMargin: units.gu(2)
176 }
177- source: coverRow.count !== 0 && coverRow.covers[0] !== "" && coverRow.covers[0] !== undefined
178- ? (coverRow.covers[0].art !== undefined
179- ? coverRow.covers[0].art
180- : "image://albumart/artist=" + coverRow.covers[0].author + "&album=" + coverRow.covers[0].album)
181- : Qt.resolvedUrl("../images/music-app-cover@30.png")
182- onStatusChanged: {
183- if (status === Image.Error) {
184- source = Qt.resolvedUrl("../images/music-app-cover@30.png")
185- }
186- }
187+ covers: coverRow.covers
188+ size: coverSize
189+ visible: showCovers && isSquare
190 }
191
192 Loader {

Subscribers

People subscribed via source and target branches