Merge lp:~vthompson/music-app/shade-on-press into lp:music-app/trusty

Proposed by Victor Thompson
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 563
Merged at revision: 570
Proposed branch: lp:~vthompson/music-app/shade-on-press
Merge into: lp:music-app/trusty
Diff against target: 401 lines (+123/-78)
12 files modified
MusicAlbums.qml (+64/-63)
MusicArtists.qml (+3/-0)
MusicNowPlaying.qml (+14/-13)
MusicPlaylists.qml (+4/-0)
MusicStart.qml (+9/-0)
MusicTracks.qml (+4/-0)
MusicaddtoPlaylist.qml (+4/-0)
common/AlbumsPage.qml (+3/-2)
common/CoverRow.qml (+9/-0)
common/ListItemWithActions.qml (+4/-0)
common/MusicRow.qml (+1/-0)
common/SongsPage.qml (+4/-0)
To merge this branch: bzr merge lp:~vthompson/music-app/shade-on-press
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+230215@code.launchpad.net

Commit message

Make UbuntuShapes appear pressed

Description of the change

Make UbuntuShapes appear pressed. I filed a bug in the ubuntu-ui-toolkit that may be fixed in the future expose this functionality in the SDK [1]

[1] https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1354753

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)
562. By Victor Thompson

merge trunk

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
Andrew Hayzen (ahayzen) wrote :

Are you able to add this to the UbuntuShapes on the Now Playing page?

Note that doesn't currently use MusicRow.

review: Needs Fixing
563. By Victor Thompson

Add CoverRow to Now Playing page with pressed catch

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
Andrew Hayzen (ahayzen) wrote :

Looks much better with the Now Playing using the CoverRow as well as the shade on press :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MusicAlbums.qml'
2--- MusicAlbums.qml 2014-07-09 03:16:28 +0000
3+++ MusicAlbums.qml 2014-08-14 00:23:23 +0000
4@@ -69,82 +69,80 @@
5 Component {
6 id: albumDelegate
7 Item {
8+ property string artist: model.artist
9+ property string album: model.title
10+ property var covers: [{author: model.artist, album: model.title}]
11+
12 id: albumItem
13 height: albumlist.cellHeight - units.gu(1)
14 width: albumlist.cellHeight - units.gu(1)
15 anchors.margins: units.gu(1)
16- UbuntuShape {
17+
18+ CoverRow {
19 id: albumShape
20- height: albumItem.width
21- width: albumItem.width
22- radius: "medium"
23- image: Image {
24- id: icon
25- fillMode: Image.Stretch
26- source: "image://albumart/artist=" + model.artist + "&album=" + model.title
27- onStatusChanged: {
28- if (status === Image.Error) {
29- source = Qt.resolvedUrl("images/music-app-cover@30.png")
30- }
31- }
32- }
33- Item { // Background so can see text in current state
34- id: albumBg
35+ anchors {
36+ top: parent.top
37+ left: parent.left
38+ verticalCenter: parent.verticalCenter
39+ }
40+ count: albumItem.covers.length
41+ size: albumItem.width
42+ covers: albumItem.covers
43+ spacing: units.gu(2)
44+ }
45+ Item { // Background so can see text in current state
46+ id: albumBg
47+ anchors {
48+ bottom: parent.bottom
49+ left: parent.left
50+ right: parent.right
51+ }
52+ height: units.gu(5)
53+ clip: true
54+ UbuntuShape{
55 anchors {
56 bottom: parent.bottom
57 left: parent.left
58 right: parent.right
59 }
60- height: units.gu(5)
61- clip: true
62- UbuntuShape{
63- anchors {
64- bottom: parent.bottom
65- left: parent.left
66- right: parent.right
67- }
68- height: albumShape.height
69- radius: "medium"
70- color: styleMusic.common.black
71- opacity: 0.6
72- }
73- }
74- Label {
75- id: albumArtist
76- objectName: "albums-albumartist"
77- anchors.bottom: parent.bottom
78- anchors.bottomMargin: units.gu(1)
79- anchors.left: parent.left
80- anchors.leftMargin: units.gu(1)
81- anchors.right: parent.right
82- anchors.rightMargin: units.gu(1)
83- color: styleMusic.common.white
84- elide: Text.ElideRight
85- text: model.artist
86- fontSize: "x-small"
87- }
88- Label {
89- id: albumLabel
90- anchors.bottom: parent.bottom
91- anchors.bottomMargin: units.gu(3)
92- anchors.left: parent.left
93- anchors.leftMargin: units.gu(1)
94- anchors.right: parent.right
95- anchors.rightMargin: units.gu(1)
96- color: styleMusic.common.white
97- elide: Text.ElideRight
98- text: model.title
99- fontSize: "small"
100- font.weight: Font.DemiBold
101- }
102- }
103+ height: albumShape.height
104+ radius: "medium"
105+ color: styleMusic.common.black
106+ opacity: 0.6
107+ }
108+ }
109+ Label {
110+ id: albumArtist
111+ objectName: "albums-albumartist"
112+ anchors.bottom: parent.bottom
113+ anchors.bottomMargin: units.gu(1)
114+ anchors.left: parent.left
115+ anchors.leftMargin: units.gu(1)
116+ anchors.right: parent.right
117+ anchors.rightMargin: units.gu(1)
118+ color: styleMusic.common.white
119+ elide: Text.ElideRight
120+ text: model.artist
121+ fontSize: "x-small"
122+ }
123+ Label {
124+ id: albumLabel
125+ anchors.bottom: parent.bottom
126+ anchors.bottomMargin: units.gu(3)
127+ anchors.left: parent.left
128+ anchors.leftMargin: units.gu(1)
129+ anchors.right: parent.right
130+ anchors.rightMargin: units.gu(1)
131+ color: styleMusic.common.white
132+ elide: Text.ElideRight
133+ text: model.title
134+ fontSize: "small"
135+ font.weight: Font.DemiBold
136+ }
137+
138
139 MouseArea {
140 anchors.fill: parent
141- onDoubleClicked: {
142- }
143- onPressAndHold: {
144- }
145 onClicked: {
146 songsPage.album = model.title;
147 songsPage.covers = [{author: model.artist, album: model.title}]
148@@ -156,6 +154,9 @@
149
150 mainPageStack.push(songsPage)
151 }
152+
153+ // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
154+ onPressedChanged: albumShape.pressed = pressed
155 }
156 }
157 }
158
159=== modified file 'MusicArtists.qml'
160--- MusicArtists.qml 2014-07-11 22:29:21 +0000
161+++ MusicArtists.qml 2014-08-14 00:23:23 +0000
162@@ -124,6 +124,9 @@
163
164 mainPageStack.push(albumsPage)
165 }
166+
167+ // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
168+ onPressedChanged: musicRow.pressed = pressed
169 }
170 }
171 }
172
173=== modified file 'MusicNowPlaying.qml'
174--- MusicNowPlaying.qml 2014-08-08 17:17:55 +0000
175+++ MusicNowPlaying.qml 2014-08-14 00:23:23 +0000
176@@ -173,6 +173,9 @@
177 }
178 }
179
180+ // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
181+ onPressedChanged: trackImage.pressed = pressed
182+
183 Rectangle {
184 id: trackContainer;
185 anchors {
186@@ -197,21 +200,19 @@
187 to: units.gu(0.5)
188 }
189
190- UbuntuShape {
191+ CoverRow {
192 id: trackImage
193- anchors.left: parent.left
194- anchors.leftMargin: units.gu(1.5)
195- anchors.top: parent.top
196- height: (queueListItem.state === "current" ? queuelist.currentHeight - units.gu(8) : queuelist.normalHeight) - units.gu(2)
197- width: height
198- image: Image {
199- source: "image://albumart/artist=" + model.author + "&album=" + model.album
200- onStatusChanged: {
201- if (status === Image.Error) {
202- source = Qt.resolvedUrl("images/music-app-cover@30.png")
203- }
204- }
205+
206+ anchors {
207+ top: parent.top
208+ left: parent.left
209+ leftMargin: units.gu(1.5)
210 }
211+ count: 1
212+ size: (queueListItem.state === "current" ? queuelist.currentHeight - units.gu(8) : queuelist.normalHeight) - units.gu(2)
213+ covers: [{author: model.author, album: model.album}]
214+
215+ spacing: units.gu(2)
216
217 function calcAnchors() {
218 if (trackImage.height > queuelist.normalHeight && mainView.wideAspect) {
219
220=== modified file 'MusicPlaylists.qml'
221--- MusicPlaylists.qml 2014-08-08 17:09:57 +0000
222+++ MusicPlaylists.qml 2014-08-14 00:23:23 +0000
223@@ -163,7 +163,11 @@
224 mainPageStack.push(songsPage)
225 }
226
227+ // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
228+ onPressedChanged: musicRow.pressed = pressed
229+
230 MusicRow {
231+ id: musicRow
232 covers: playlist.covers
233 column: Column {
234 spacing: units.gu(1)
235
236=== modified file 'MusicStart.qml'
237--- MusicStart.qml 2014-08-12 16:14:16 +0000
238+++ MusicStart.qml 2014-08-14 00:23:23 +0000
239@@ -203,6 +203,9 @@
240
241 mainPageStack.push(songsPage)
242 }
243+
244+ // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
245+ onPressedChanged: recentShape.pressed = pressed
246 }
247 }
248 }
249@@ -310,6 +313,9 @@
250
251 mainPageStack.push(songsPage)
252 }
253+
254+ // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
255+ onPressedChanged: genreShape.pressed = pressed
256 }
257 Item { // Background so can see text in current state
258 id: genreBg
259@@ -441,6 +447,9 @@
260
261 mainPageStack.push(songsPage)
262 }
263+
264+ // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
265+ onPressedChanged: albumShape.pressed = pressed
266 }
267 Item { // Background so can see text in current state
268 id: albumBg
269
270=== modified file 'MusicTracks.qml'
271--- MusicTracks.qml 2014-08-05 22:06:49 +0000
272+++ MusicTracks.qml 2014-08-14 00:23:23 +0000
273@@ -69,9 +69,13 @@
274 ]
275 triggerActionOnMouseRelease: true
276
277+ // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
278+ onPressedChanged: musicRow.pressed = pressed
279+
280 onItemClicked: trackClicked(tracklist.model, index) // play track
281
282 MusicRow {
283+ id: musicRow
284 covers: [{author: model.author, album: model.album}]
285 column: Column {
286 spacing: units.gu(1)
287
288=== modified file 'MusicaddtoPlaylist.qml'
289--- MusicaddtoPlaylist.qml 2014-08-07 20:57:06 +0000
290+++ MusicaddtoPlaylist.qml 2014-08-14 00:23:23 +0000
291@@ -91,7 +91,11 @@
292 musicToolbar.goBack(); // go back to the previous page
293 }
294
295+ // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
296+ onPressedChanged: musicRow.pressed = pressed
297+
298 MusicRow {
299+ id: musicRow
300 covers: Playlists.getPlaylistCovers(playlist.name)
301 column: Column {
302 spacing: units.gu(1)
303
304=== modified file 'common/AlbumsPage.qml'
305--- common/AlbumsPage.qml 2014-07-13 00:16:14 +0000
306+++ common/AlbumsPage.qml 2014-08-14 00:23:23 +0000
307@@ -260,8 +260,6 @@
308
309 MouseArea {
310 anchors.fill: parent
311- onDoubleClicked: {
312- }
313 onClicked: {
314 if (focus == false) {
315 focus = true
316@@ -277,6 +275,9 @@
317
318 mainPageStack.push(songsPage)
319 }
320+
321+ // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
322+ onPressedChanged: albumImage.pressed = pressed
323 }
324 }
325
326
327=== modified file 'common/CoverRow.qml'
328--- common/CoverRow.qml 2014-05-23 15:00:21 +0000
329+++ common/CoverRow.qml 2014-08-14 00:23:23 +0000
330@@ -35,6 +35,9 @@
331 // Property to set the spacing size, default to units.gu(1)
332 property var spacing: units.gu(1)
333
334+ // Property to determine if item should appear pressed
335+ property bool pressed: false
336+
337 width: size
338 height: size
339 radius: "medium"
340@@ -76,5 +79,11 @@
341 anchors.centerIn: parent
342 hideSource: true
343 }
344+
345+ // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
346+ onPressedChanged: {
347+ pressed ? borderSource = "radius_pressed.sci"
348+ : borderSource = "radius_idle.sci"
349+ }
350 }
351
352
353=== modified file 'common/ListItemWithActions.qml'
354--- common/ListItemWithActions.qml 2014-08-11 00:14:56 +0000
355+++ common/ListItemWithActions.qml 2014-08-14 00:23:23 +0000
356@@ -27,6 +27,7 @@
357 property list<Action> rightSideActions
358 property double defaultHeight: units.gu(8)
359 property bool locked: false
360+ property bool pressed: false
361 property Action activeAction: null
362 property var activeItem: null
363 property bool triggerActionOnMouseRelease: false
364@@ -542,6 +543,9 @@
365 root.itemPressAndHold(mouse)
366 }
367 }
368+
369+ onPressedChanged: root.pressed = pressed
370+
371 z: -1
372 }
373 }
374
375=== modified file 'common/MusicRow.qml'
376--- common/MusicRow.qml 2014-08-04 22:38:18 +0000
377+++ common/MusicRow.qml 2014-08-14 00:23:23 +0000
378@@ -30,6 +30,7 @@
379 }
380
381 property alias covers: coverRow.covers
382+ property alias pressed: coverRow.pressed
383 property alias column: columnComponent.sourceComponent
384
385 spacing: units.gu(1)
386
387=== modified file 'common/SongsPage.qml'
388--- common/SongsPage.qml 2014-08-11 00:31:55 +0000
389+++ common/SongsPage.qml 2014-08-14 00:23:23 +0000
390@@ -266,7 +266,11 @@
391 }
392 }
393
394+ // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
395+ onPressedChanged: musicRow.pressed = pressed
396+
397 MusicRow {
398+ id: musicRow
399 covers: [{author: model.author, album: model.album}]
400 column: Column {
401 spacing: units.gu(1)

Subscribers

People subscribed via source and target branches

to status/vote changes: