Merge lp:~ahayzen/music-app/abstract-row-second-iteration into lp:music-app/trusty

Proposed by Andrew Hayzen
Status: Merged
Approved by: Victor Thompson
Approved revision: 523
Merged at revision: 521
Proposed branch: lp:~ahayzen/music-app/abstract-row-second-iteration
Merge into: lp:music-app/trusty
Diff against target: 259 lines (+17/-80)
7 files modified
MusicArtists.qml (+0/-15)
MusicPlaylists.qml (+0/-10)
MusicSearch.qml (+0/-15)
MusicTracks.qml (+0/-15)
MusicaddtoPlaylist.qml (+0/-10)
common/MusicRow.qml (+17/-0)
common/SongsPage.qml (+0/-15)
To merge this branch: bzr merge lp:~ahayzen/music-app/abstract-row-second-iteration
Reviewer Review Type Date Requested Status
Victor Thompson Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+226549@code.launchpad.net

Commit message

* Fix to ensure that the width of the label is set and the MusicRow.qml anchors.right is set correctly so that labels elide when the expander is reached
* Set elide, height, maximumLineCount, wrapMode, verticalAlignment and width inside MusicRow.qml

Description of the change

* Fix to ensure that the width of the label is set and the MusicRow.qml anchors.right is set correctly so that labels elide when the expander is reached
* Set elide, height, maximumLineCount, wrapMode, verticalAlignment and width inside MusicRow.qml

To post a comment you must log in.
522. By Andrew Hayzen

* Tweak to include margin to expander item

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) wrote :
review: Approve (continuous-integration)
523. By Andrew Hayzen

* Add code comment to width binding

Revision history for this message
Victor Thompson (vthompson) wrote :

lgtm! Thanks for picking up on the regression and the quick turn around!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MusicArtists.qml'
2--- MusicArtists.qml 2014-07-11 18:13:51 +0000
3+++ MusicArtists.qml 2014-07-11 23:56:10 +0000
4@@ -96,36 +96,21 @@
5 Label {
6 id: trackArtistAlbum
7 color: styleMusic.common.music
8- elide: Text.ElideRight
9 fontSize: "medium"
10- height: units.gu(2)
11- maximumLineCount: 2
12 objectName: "artists-artist"
13 text: model.artist
14- wrapMode: Text.NoWrap
15- verticalAlignment: Text.AlignVCenter
16 }
17 Label {
18 id: trackArtistAlbums
19 color: styleMusic.common.subtitle
20- elide: Text.ElideRight
21 fontSize: "x-small"
22- height: units.gu(2)
23- maximumLineCount: 2
24 text: i18n.tr("%1 album", "%1 albums", albumArtistModel.rowCount).arg(albumArtistModel.rowCount)
25- wrapMode: Text.NoWrap
26- verticalAlignment: Text.AlignVCenter
27 }
28 Label {
29 id: trackArtistAlbumTracks
30 color: styleMusic.common.subtitle
31- elide: Text.ElideRight
32 fontSize: "x-small"
33- height: units.gu(2)
34- maximumLineCount: 2
35 text: i18n.tr("%1 song", "%1 songs", songArtistModel.rowCount).arg(songArtistModel.rowCount)
36- wrapMode: Text.NoWrap
37- verticalAlignment: Text.AlignVCenter
38 }
39 }
40 }
41
42=== modified file 'MusicPlaylists.qml'
43--- MusicPlaylists.qml 2014-07-11 18:13:51 +0000
44+++ MusicPlaylists.qml 2014-07-11 23:56:10 +0000
45@@ -162,24 +162,14 @@
46 Label {
47 id: playlistCount
48 color: styleMusic.common.subtitle
49- elide: Text.ElideRight
50 fontSize: "x-small"
51- height: units.gu(2)
52- maximumLineCount: 1
53 text: i18n.tr("%1 song", "%1 songs", playlist.count).arg(playlist.count)
54- wrapMode: Text.NoWrap
55- verticalAlignment: Text.AlignVCenter
56 }
57 Label {
58 id: playlistName
59 color: styleMusic.common.music
60- elide: Text.ElideRight
61 fontSize: "medium"
62- height: units.gu(2)
63- maximumLineCount: 1
64 text: playlist.name
65- wrapMode: Text.NoWrap
66- verticalAlignment: Text.AlignVCenter
67 }
68 }
69 }
70
71=== modified file 'MusicSearch.qml'
72--- MusicSearch.qml 2014-07-11 18:13:51 +0000
73+++ MusicSearch.qml 2014-07-11 23:56:10 +0000
74@@ -175,36 +175,21 @@
75 Label {
76 id: trackArtist
77 color: styleMusic.common.subtitle
78- elide: Text.ElideRight
79 fontSize: "x-small"
80- height: units.gu(2)
81- maximumLineCount: 2
82 text: model.author
83- wrapMode: Text.NoWrap
84- verticalAlignment: Text.AlignVCenter
85 }
86 Label {
87 id: trackTitle
88 color: styleMusic.common.music
89- elide: Text.ElideRight
90 fontSize: "small"
91- height: units.gu(2)
92- maximumLineCount: 1
93 objectName: "tracktitle"
94 text: model.title
95- wrapMode: Text.NoWrap
96- verticalAlignment: Text.AlignVCenter
97 }
98 Label {
99 id: trackAlbum
100 color: styleMusic.common.subtitle
101- elide: Text.ElideRight
102 fontSize: "xx-small"
103- height: units.gu(2)
104- maximumLineCount: 2
105 text: model.album
106- wrapMode: Text.NoWrap
107- verticalAlignment: Text.AlignVCenter
108 }
109 }
110 }
111
112=== modified file 'MusicTracks.qml'
113--- MusicTracks.qml 2014-07-11 18:13:51 +0000
114+++ MusicTracks.qml 2014-07-11 23:56:10 +0000
115@@ -77,38 +77,23 @@
116 Label {
117 id: trackArtist
118 color: styleMusic.common.subtitle
119- elide: Text.ElideRight
120 fontSize: "x-small"
121- height: units.gu(2)
122- maximumLineCount: 2
123 text: model.author
124- wrapMode: Text.NoWrap
125- verticalAlignment: Text.AlignVCenter
126 }
127
128 Label {
129 id: trackTitle
130 color: styleMusic.common.music
131- elide: Text.ElideRight
132 fontSize: "medium"
133- height: units.gu(2)
134- maximumLineCount: 1
135 objectName: "tracktitle"
136 text: model.title
137- wrapMode: Text.NoWrap
138- verticalAlignment: Text.AlignVCenter
139 }
140
141 Label {
142 id: trackAlbum
143 color: styleMusic.common.subtitle
144- elide: Text.ElideRight
145 fontSize: "xx-small"
146- height: units.gu(2)
147- maximumLineCount: 2
148 text: model.album
149- wrapMode: Text.NoWrap
150- verticalAlignment: Text.AlignVCenter
151 }
152 }
153 }
154
155=== modified file 'MusicaddtoPlaylist.qml'
156--- MusicaddtoPlaylist.qml 2014-07-11 18:13:51 +0000
157+++ MusicaddtoPlaylist.qml 2014-07-11 23:56:10 +0000
158@@ -108,24 +108,14 @@
159 Label {
160 id: playlistCount
161 color: styleMusic.common.subtitle
162- elide: Text.ElideRight
163 fontSize: "x-small"
164- height: units.gu(2)
165- maximumLineCount: 1
166 text: i18n.tr("%1 song", "%1 songs", playlist.count).arg(playlist.count)
167- wrapMode: Text.NoWrap
168- verticalAlignment: Text.AlignVCenter
169 }
170 Label {
171 id: playlistName
172 color: styleMusic.common.music
173- elide: Text.ElideRight
174 fontSize: "medium"
175- height: units.gu(2)
176- maximumLineCount: 1
177 text: playlist.name
178- wrapMode: Text.NoWrap
179- verticalAlignment: Text.AlignVCenter
180 }
181 }
182 }
183
184=== modified file 'common/MusicRow.qml'
185--- common/MusicRow.qml 2014-06-30 22:35:34 +0000
186+++ common/MusicRow.qml 2014-07-11 23:56:10 +0000
187@@ -25,6 +25,9 @@
188 anchors {
189 left: parent.left
190 leftMargin: units.gu(1)
191+ right: parent.right
192+ // Set to expander item width for now set to 1GU when using listitem actions
193+ rightMargin: (styleMusic.common.expandedItem * 2) + units.gu(1)
194 }
195
196 property alias covers: coverRow.covers
197@@ -49,5 +52,19 @@
198 top: parent.top
199 topMargin: units.gu(2)
200 }
201+ width: parent.width - coverRow.width - parent.spacing
202+
203+ onSourceComponentChanged: {
204+ for (var i=0; i < item.children.length; i++) {
205+ item.children[i].elide = Text.ElideRight
206+ item.children[i].height = units.gu(2)
207+ item.children[i].maximumLineCount = 1
208+ item.children[i].wrapMode = Text.NoWrap
209+ item.children[i].verticalAlignment = Text.AlignVCenter
210+
211+ // binds to width so it is updated when screen size changes
212+ item.children[i].width = Qt.binding(function () { return width; })
213+ }
214+ }
215 }
216 }
217
218=== modified file 'common/SongsPage.qml'
219--- common/SongsPage.qml 2014-07-11 18:13:51 +0000
220+++ common/SongsPage.qml 2014-07-11 23:56:10 +0000
221@@ -247,38 +247,23 @@
222 Label {
223 id: trackArtist
224 color: styleMusic.common.subtitle
225- elide: Text.ElideRight
226 fontSize: "x-small"
227- height: units.gu(2)
228- maximumLineCount: 2
229 text: model.author
230- wrapMode: Text.NoWrap
231- verticalAlignment: Text.AlignVCenter
232 }
233
234 Label {
235 id: trackTitle
236 color: styleMusic.common.subtitle
237- elide: Text.ElideRight
238 fontSize: "medium"
239- height: units.gu(2)
240- maximumLineCount: 1
241 objectName: "songspage-tracktitle"
242 text: model.title
243- wrapMode: Text.NoWrap
244- verticalAlignment: Text.AlignVCenter
245 }
246
247 Label {
248 id: trackAlbum
249 color: styleMusic.common.subtitle
250- elide: Text.ElideRight
251 fontSize: "xx-small"
252- height: units.gu(2)
253- maximumLineCount: 2
254 text: model.album
255- wrapMode: Text.NoWrap
256- verticalAlignment: Text.AlignVCenter
257 }
258 }
259 }

Subscribers

People subscribed via source and target branches

to status/vote changes: