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
=== modified file 'MusicNowPlaying.qml'
--- MusicNowPlaying.qml 2014-10-13 12:36:59 +0000
+++ MusicNowPlaying.qml 2014-10-20 15:58:04 +0000
@@ -89,19 +89,15 @@
89 anchors.top: parent.top89 anchors.top: parent.top
90 anchors.topMargin: mainView.header.height90 anchors.topMargin: mainView.header.height
91 height: units.gu(27)91 height: units.gu(27)
92 art: albumImage.source92 art: albumImage.firstSource
9393
94 Image {94 CoverGrid {
95 id: albumImage95 id: albumImage
96 anchors.centerIn: parent96 anchors {
97 width: units.gu(18)97 centerIn: parent
98 height: width98 }
99 smooth: true99 covers: [{art: player.currentMetaArt, author: player.currentMetaArtist, album: player.currentMetaAlbum}]
100 source: player.currentMetaArt === "" ?100 size: units.gu(18)
101 decodeURIComponent("image://albumart/artist=" +
102 player.currentMetaArtist +
103 "&album=" + player.currentMetaAlbum)
104 : player.currentMetaArt
105 }101 }
106 }102 }
107103
108104
=== modified file 'MusicToolbar.qml'
--- MusicToolbar.qml 2014-10-08 18:33:38 +0000
+++ MusicToolbar.qml 2014-10-20 15:58:04 +0000
@@ -22,6 +22,7 @@
22import QtMultimedia 5.022import QtMultimedia 5.0
23import Ubuntu.Components 1.123import Ubuntu.Components 1.1
24import Ubuntu.Components.Popups 1.024import Ubuntu.Components.Popups 1.0
25import "common"
25import "settings.js" as Settings26import "settings.js" as Settings
2627
27Item {28Item {
@@ -201,26 +202,15 @@
201 color: "transparent"202 color: "transparent"
202203
203 /* Album art in player controls */204 /* Album art in player controls */
204 Image {205 CoverGrid {
205 id: playerControlsImage206 id: playerControlsImage
206 anchors {207 anchors {
207 bottom: parent.bottom208 bottom: parent.bottom
208 left: parent.left209 left: parent.left
209 top: parent.top210 top: parent.top
210 }211 }
211 smooth: true212 covers: [{art: player.currentMetaArt, author: player.currentMetaArtist, album: player.currentMetaArt}]
212 source: player.currentMetaArt === "" ?213 size: parent.height
213 decodeURIComponent("image://albumart/artist=" +
214 player.currentMetaArtist +
215 "&album=" + player.currentMetaAlbum)
216 : player.currentMetaArt
217 width: parent.height
218
219 onStatusChanged: {
220 if (status === Image.Error) {
221 source = Qt.resolvedUrl("../images/music-app-cover@30.png")
222 }
223 }
224 }214 }
225215
226 /* Column of meta labels */216 /* Column of meta labels */
227217
=== modified file 'common/BlurredBackground.qml'
--- common/BlurredBackground.qml 2014-10-04 00:56:45 +0000
+++ common/BlurredBackground.qml 2014-10-20 15:58:04 +0000
@@ -42,12 +42,8 @@
42 height: parent.height42 height: parent.height
43 width: Math.max(parent.height, parent.width)43 width: Math.max(parent.height, parent.width)
44 visible: false44 visible: false
45 onStatusChanged: {
46 if (status === Image.Error) {
47 source = Qt.resolvedUrl("../images/music-app-cover@30.png")
48 }
49 }
50 }45 }
46
51 // the blur47 // the blur
52 FastBlur {48 FastBlur {
53 id: backgroundBlur49 id: backgroundBlur
5450
=== modified file 'common/BlurredHeader.qml'
--- common/BlurredHeader.qml 2014-10-16 23:36:00 +0000
+++ common/BlurredHeader.qml 2014-10-20 15:58:04 +0000
@@ -31,11 +31,7 @@
31 BlurredBackground {31 BlurredBackground {
32 id: blurredBackground32 id: blurredBackground
33 height: parent.height33 height: parent.height
34 art: coversImage.covers.length > 034 art: coversImage.firstSource
35 ? (coversImage.covers[0].art !== undefined
36 ? coversImage.covers[0].art
37 : decodeURIComponent("image://albumart/artist=" + coversImage.covers[0].author + "&album=" + coversImage.covers[0].album))
38 : Qt.resolvedUrl("../images/music-app-cover@30.png")
39 }35 }
4036
41 CoverGrid {37 CoverGrid {
4238
=== modified file 'common/CoverGrid.qml'
--- common/CoverGrid.qml 2014-10-13 16:32:09 +0000
+++ common/CoverGrid.qml 2014-10-20 15:58:04 +0000
@@ -32,6 +32,8 @@
32 // Property to set the size of the cover image32 // Property to set the size of the cover image
33 property int size33 property int size
3434
35 property string firstSource
36
35 onCoversChanged: {37 onCoversChanged: {
36 if (covers !== undefined) {38 if (covers !== undefined) {
37 while (covers.length > 4) { // remove any covers after 439 while (covers.length > 4) { // remove any covers after 4
@@ -58,10 +60,15 @@
58 ? (coverGrid.covers[index].art !== undefined60 ? (coverGrid.covers[index].art !== undefined
59 ? coverGrid.covers[index].art61 ? coverGrid.covers[index].art
60 : "image://albumart/artist=" + coverGrid.covers[index].author + "&album=" + coverGrid.covers[index].album)62 : "image://albumart/artist=" + coverGrid.covers[index].author + "&album=" + coverGrid.covers[index].album)
61 : Qt.resolvedUrl("../images/music-app-cover@30.png")63 : undefined
64 sourceSize.height: height
65 sourceSize.width: width
66
62 onStatusChanged: {67 onStatusChanged: {
63 if (status === Image.Error) {68 if (status === Image.Error) {
64 source = Qt.resolvedUrl("../images/music-app-cover@30.png")69 source = Qt.resolvedUrl("../images/music-app-cover@30.png")
70 } else if (status === Image.Ready && index === 0) {
71 firstSource = source
65 }72 }
66 }73 }
67 }74 }
6875
=== modified file 'common/CoverRow.qml'
--- common/CoverRow.qml 2014-09-20 15:41:33 +0000
+++ common/CoverRow.qml 2014-10-20 15:58:04 +0000
@@ -63,6 +63,8 @@
63 ? coverRow.covers[index].art63 ? coverRow.covers[index].art
64 : "image://albumart/artist=" + coverRow.covers[index].author + "&album=" + coverRow.covers[index].album)64 : "image://albumart/artist=" + coverRow.covers[index].author + "&album=" + coverRow.covers[index].album)
65 : Qt.resolvedUrl("../images/music-app-cover@30.png")65 : Qt.resolvedUrl("../images/music-app-cover@30.png")
66 sourceSize.height: height
67 sourceSize.width: width
66 onStatusChanged: {68 onStatusChanged: {
67 if (status === Image.Error) {69 if (status === Image.Error) {
68 source = Qt.resolvedUrl("../images/music-app-cover@30.png")70 source = Qt.resolvedUrl("../images/music-app-cover@30.png")
6971
=== modified file 'common/MusicRow.qml'
--- common/MusicRow.qml 2014-10-09 00:31:51 +0000
+++ common/MusicRow.qml 2014-10-20 15:58:04 +0000
@@ -50,27 +50,17 @@
50 size: coverSize50 size: coverSize
51 }51 }
5252
53 Image {53 CoverGrid {
54 id: coverSquare54 id: coverSquare
55 visible: showCovers && isSquare
56 width: coverSize
57 height: coverSize
58 anchors {55 anchors {
59 verticalCenter: parent.verticalCenter56 verticalCenter: parent.verticalCenter
60 topMargin: units.gu(0.5)57 topMargin: units.gu(0.5)
61 bottomMargin: units.gu(0.5)58 bottomMargin: units.gu(0.5)
62 leftMargin: units.gu(2)59 leftMargin: units.gu(2)
63 }60 }
64 source: coverRow.count !== 0 && coverRow.covers[0] !== "" && coverRow.covers[0] !== undefined61 covers: coverRow.covers
65 ? (coverRow.covers[0].art !== undefined62 size: coverSize
66 ? coverRow.covers[0].art63 visible: showCovers && isSquare
67 : "image://albumart/artist=" + coverRow.covers[0].author + "&album=" + coverRow.covers[0].album)
68 : Qt.resolvedUrl("../images/music-app-cover@30.png")
69 onStatusChanged: {
70 if (status === Image.Error) {
71 source = Qt.resolvedUrl("../images/music-app-cover@30.png")
72 }
73 }
74 }64 }
7565
76 Loader {66 Loader {

Subscribers

People subscribed via source and target branches