Merge lp:~nik90/music-app/album-code-refactor-and-fixes into lp:music-app/trusty
- album-code-refactor-and-fixes
- Merge into trusty
Status: | Rejected |
---|---|
Rejected by: | Andrew Hayzen |
Proposed branch: | lp:~nik90/music-app/album-code-refactor-and-fixes |
Merge into: | lp:music-app/trusty |
Diff against target: |
857 lines (+303/-264) 7 files modified
MusicAlbums.qml (+224/-263) MusicArtists.qml (+6/-0) MusicNowPlaying.qml (+1/-0) MusicPlaylists.qml (+4/-1) MusicStart.qml (+4/-0) MusicTracks.qml (+1/-0) common/ImageButton.qml (+63/-0) |
To merge this branch: | bzr merge lp:~nik90/music-app/album-code-refactor-and-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nekhelesh Ramananthan (community) | Disapprove | ||
Victor Thompson | Needs Fixing | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Needs Fixing | |
Review via email: mp+200946@code.launchpad.net |
Commit message
This commit implements the following,
- Fixes missing playlist count in the playlist page (Bug #1267315)
- Removes some redundant code declarations.
- Added code indentation and spacing to allow for better code readability
- Where possible use column and row to remove anchor definitions in the elements themselves.
- Added new component ImageButton which is derived from the Abstract Button. This is used in places like the expandable where "Add to Playlist" and "Add to queue" actions are required.
- Changed the UbuntuShape radius to "medium" throughout the app as can be observed in the design spec at https:/
- Tweaked grid flow type to LeftToRight to ensure that the grid view uses the application width and height efficiently.
Description of the change
This MP implements the following,
- Fixes missing playlist count in the playlist page (Bug #1267315)
- Added new component ImageButton which is derived from the Abstract Button. This is used in places like the expandable where "Add to Playlist" and "Add to queue" actions are required instead of using a label and icon by themselves. (only in MusicAlbums.qml for this MP)
- Removes some redundant code declarations like the following,
1. wrapMode: Text.NoWrap is not required since the default wrapMode is NoWrap.
2. MaximumLineCount: 1 is also not required since if you declare the width of the label, it will automatically restrict the label to 1 line.
3. Many times I saw empty signals like onDoublePressed{} with no code inside it. I removed them since they do nothing.
- Added code indentation and spacing to allow for better code readability
- Changed the UbuntuShape radius to "medium" throughout the app as can be observed in the design spec at https:/
- Where possible use column and row to remove anchor definitions in the elements themselves.
UPDATE1: Tweaked grid flow type to LeftToRight to ensure that the grid view uses the application width and height efficiently. Before this fix, the grid would always show the albums vertically even if there were sufficient width. This is suboptimal behaviour.
NOTE: This kind of code refactor and organization is required in other pages. However to make it easier to review and also reduce the risk of regression, I will do it in several MP. This MP was focussed on the MusicAlbums.qml file alone.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Victor Thompson (vthompson) wrote : | # |
Thanks for the count fix. I never noticed it--I haven't paid much attention to the playlist portion of the app as that was mostly Daniel's baby. I'm not 100% sure the UbuntuShapes should be modified to have a medium radius, however. I thought most of the spec elements were NOT that round (besides the larger shapes in the Music in Albums tabs). The spec almost seems oddly somewhere between the default (small) and medium, but closer to small. BUT, I know most other apps are using the rounder version of the components. At first I assumed I wouldn't prefer the cover art images at a medium radius, but I actually do like it visualized that way now that I see it.
The refactor portion of this still needs to be reviewed a bit--I don't have time at the moment.
Nekhelesh Ramananthan (nik90) wrote : | # |
Let me know what your final decision is regarding the ubuntu shape. Personally I like the "medium" radius since it matches with other apps and also looks good. But I leave that entirely up to you. As for the refactor portion, I will have one final look at my changes.
It seems that one of the tests is failing due to my code refactor. I tried fixing the test, but I am terrible with python and wasn't able to fix. Do you mind looking at it while reviewing my code and proposing a fix? The failing test is music_app.
- 303. By Nekhelesh Ramananthan
-
Tweaked grid behaviour to take advantage of the app width and height
- 304. By Nekhelesh Ramananthan
-
reverted manifest.json file change
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:304
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Victor Thompson (vthompson) wrote : | # |
I believe you'll need to revert your changes in r303. The Albums tab is supposed to flow left to right as it did previously, as per the design spec.
Victor Thompson (vthompson) wrote : | # |
One more thing is that the playlist count not being shown should be fixed by the branch I have proposed to merge that completes the app's move to using the Sheet property, per the design spec. The Page that you are fixing will actually be removed by that MP.
Nekhelesh Ramananthan (nik90) wrote : | # |
Considering that the page I did the code refactoring for does not exist and bug fixes made in another MP, I am disapproving this branch.
>I believe you'll need to revert your changes in r303. The Albums tab is supposed to flow left to right as it >did previously, as per the design spec.
You might want to check the music app trunk. In the albums tab, the albums are supposed to use a organic view as per design spec. However currently the music app shows the albums vertically there by wasting application width when viewed on the desktop. None the less, this MP is disapproved, so it doesn't matter.
Andrew Hayzen (ahayzen) wrote : | # |
Shall I reject the MP for you?
Regarding the organic view this wasn't added before due to time constraints, but it is on our list of things todo :-)
Nekhelesh Ramananthan (nik90) wrote : | # |
Yeah please do. Thanks.
Unmerged revisions
- 304. By Nekhelesh Ramananthan
-
reverted manifest.json file change
- 303. By Nekhelesh Ramananthan
-
Tweaked grid behaviour to take advantage of the app width and height
- 302. By Nekhelesh Ramananthan
-
Changed ubuntu shape radius to medium throughout app
- 301. By Nekhelesh Ramananthan
-
merge from trunk
- 300. By Nekhelesh Ramananthan
-
Fixed missing playlist count in the playlist page
- 299. By Nekhelesh Ramananthan
-
Revert accidental manifest.json change
- 298. By Nekhelesh Ramananthan
-
Organised the entire album tab code
Preview Diff
1 | === modified file 'MusicAlbums.qml' | |||
2 | --- MusicAlbums.qml 2013-12-23 22:53:59 +0000 | |||
3 | +++ MusicAlbums.qml 2014-01-09 14:17:52 +0000 | |||
4 | @@ -16,20 +16,20 @@ | |||
5 | 16 | */ | 16 | */ |
6 | 17 | 17 | ||
7 | 18 | import QtQuick 2.0 | 18 | import QtQuick 2.0 |
8 | 19 | import QtMultimedia 5.0 | ||
9 | 19 | import Ubuntu.Components 0.1 | 20 | import Ubuntu.Components 0.1 |
11 | 20 | import Ubuntu.Components.ListItems 0.1 | 21 | import QtGraphicalEffects 1.0 |
12 | 22 | import QtQuick.LocalStorage 2.0 | ||
13 | 21 | import Ubuntu.Components.Popups 0.1 | 23 | import Ubuntu.Components.Popups 0.1 |
14 | 22 | import Ubuntu.Components.ListItems 0.1 as ListItem | 24 | import Ubuntu.Components.ListItems 0.1 as ListItem |
15 | 23 | import QtMultimedia 5.0 | ||
16 | 24 | import QtQuick.LocalStorage 2.0 | ||
17 | 25 | import QtGraphicalEffects 1.0 | ||
18 | 26 | import "settings.js" as Settings | ||
19 | 27 | import "meta-database.js" as Library | 25 | import "meta-database.js" as Library |
20 | 28 | import "playlists.js" as Playlists | 26 | import "playlists.js" as Playlists |
21 | 27 | import "settings.js" as Settings | ||
22 | 29 | import "common" | 28 | import "common" |
23 | 30 | 29 | ||
24 | 31 | Page { | 30 | Page { |
25 | 32 | id: mainpage | 31 | id: mainpage |
26 | 32 | |||
27 | 33 | title: i18n.tr("Albums") | 33 | title: i18n.tr("Albums") |
28 | 34 | 34 | ||
29 | 35 | property string artist: "" | 35 | property string artist: "" |
30 | @@ -42,9 +42,7 @@ | |||
31 | 42 | 42 | ||
32 | 43 | onVisibleChanged: { | 43 | onVisibleChanged: { |
33 | 44 | if (visible === true) | 44 | if (visible === true) |
34 | 45 | { | ||
35 | 46 | musicToolbar.setPage(mainpage); | 45 | musicToolbar.setPage(mainpage); |
36 | 47 | } | ||
37 | 48 | } | 46 | } |
38 | 49 | 47 | ||
39 | 50 | MusicSettings { | 48 | MusicSettings { |
40 | @@ -53,27 +51,34 @@ | |||
41 | 53 | 51 | ||
42 | 54 | GridView { | 52 | GridView { |
43 | 55 | id: albumlist | 53 | id: albumlist |
50 | 56 | anchors.fill: parent | 54 | |
51 | 57 | anchors.leftMargin: units.gu(1) | 55 | anchors { |
52 | 58 | anchors.topMargin: units.gu(1) | 56 | fill: parent |
53 | 59 | anchors.bottomMargin: units.gu(1) | 57 | margins: units.gu(1) |
54 | 60 | cellHeight: (parent.height - units.gu(2))/3 | 58 | } |
55 | 61 | cellWidth: (parent.height - units.gu(2))/3 | 59 | |
56 | 62 | model: albumModel.model | 60 | model: albumModel.model |
57 | 63 | delegate: albumDelegate | 61 | delegate: albumDelegate |
59 | 64 | flow: GridView.TopToBottom | 62 | flow: GridView.LeftToRight |
60 | 63 | cellHeight: mainpage.width <= units.gu(50) ? (mainpage.width - albumlist.anchors.margins)/2 : (units.gu(60) - albumlist.anchors.margins)/3 | ||
61 | 64 | cellWidth: cellHeight | ||
62 | 65 | 65 | ||
63 | 66 | Component { | 66 | Component { |
64 | 67 | id: albumDelegate | 67 | id: albumDelegate |
65 | 68 | Item { | 68 | Item { |
66 | 69 | id: albumItem | 69 | id: albumItem |
67 | 70 | |||
68 | 70 | height: albumlist.cellHeight - units.gu(1) | 71 | height: albumlist.cellHeight - units.gu(1) |
69 | 71 | width: albumlist.cellHeight - units.gu(1) | 72 | width: albumlist.cellHeight - units.gu(1) |
70 | 72 | anchors.margins: units.gu(1) | 73 | anchors.margins: units.gu(1) |
71 | 74 | |||
72 | 73 | UbuntuShape { | 75 | UbuntuShape { |
73 | 74 | id: albumShape | 76 | id: albumShape |
74 | 77 | |||
75 | 75 | height: albumItem.width | 78 | height: albumItem.width |
76 | 76 | width: albumItem.width | 79 | width: albumItem.width |
77 | 80 | radius: "medium" | ||
78 | 81 | |||
79 | 77 | image: Image { | 82 | image: Image { |
80 | 78 | id: icon | 83 | id: icon |
81 | 79 | fillMode: Image.Stretch | 84 | fillMode: Image.Stretch |
82 | @@ -86,58 +91,58 @@ | |||
83 | 86 | property string year: model.year | 91 | property string year: model.year |
84 | 87 | source: cover !== "" ? cover : "images/cover_default.png" | 92 | source: cover !== "" ? cover : "images/cover_default.png" |
85 | 88 | } | 93 | } |
129 | 89 | UbuntuShape { // Background so can see text in current state | 94 | |
130 | 90 | id: albumBg2 | 95 | // Black Bar to contain the album title and artist |
131 | 91 | anchors.bottom: parent.bottom | 96 | UbuntuShape { |
132 | 92 | color: styleMusic.common.black | 97 | anchors { |
133 | 93 | height: units.gu(4) | 98 | left: parent.left |
134 | 94 | width: parent.width | 99 | right: parent.right |
135 | 95 | } | 100 | bottom: parent.bottom |
136 | 96 | Rectangle { // Background so can see text in current state | 101 | } |
137 | 97 | id: albumBg | 102 | |
138 | 98 | anchors.bottom: parent.bottom | 103 | radius: "medium" |
139 | 99 | anchors.bottomMargin: units.gu(2) | 104 | height: units.gu(5) |
140 | 100 | color: styleMusic.common.black | 105 | color: styleMusic.common.black |
141 | 101 | height: units.gu(3) | 106 | |
142 | 102 | width: parent.width | 107 | // Black rectangle to remove the curved corners at the top |
143 | 103 | } | 108 | Rectangle { |
144 | 104 | Label { | 109 | anchors { fill: parent; bottomMargin: units.gu(1) } |
145 | 105 | id: albumArtist | 110 | color: styleMusic.common.black |
146 | 106 | objectName: "albums-albumartist" | 111 | } |
147 | 107 | anchors.bottom: parent.bottom | 112 | |
148 | 108 | anchors.bottomMargin: units.gu(1) | 113 | Column { |
149 | 109 | anchors.left: parent.left | 114 | id: albumDataColumn |
150 | 110 | anchors.leftMargin: units.gu(.25) | 115 | anchors { |
151 | 111 | anchors.right: parent.right | 116 | verticalCenter: parent.verticalCenter |
152 | 112 | anchors.rightMargin: units.gu(.25) | 117 | left: parent.left |
153 | 113 | horizontalAlignment: Text.AlignHCenter | 118 | right: parent.right |
154 | 114 | color: styleMusic.nowPlaying.labelSecondaryColor | 119 | margins: units.gu(1) |
155 | 115 | elide: Text.ElideRight | 120 | } |
156 | 116 | text: artist | 121 | |
157 | 117 | fontSize: "x-small" | 122 | Label { |
158 | 118 | } | 123 | id: albumLabel |
159 | 119 | Label { | 124 | text: album |
160 | 120 | id: albumLabel | 125 | fontSize: "small" |
161 | 121 | anchors.bottom: parent.bottom | 126 | width: parent.width |
162 | 122 | anchors.bottomMargin: units.gu(3) | 127 | elide: Text.ElideRight |
163 | 123 | anchors.left: parent.left | 128 | color: styleMusic.common.white |
164 | 124 | anchors.leftMargin: units.gu(.25) | 129 | } |
165 | 125 | anchors.right: parent.right | 130 | |
166 | 126 | anchors.rightMargin: units.gu(.25) | 131 | Label { |
167 | 127 | horizontalAlignment: Text.AlignHCenter | 132 | id: albumArtist |
168 | 128 | color: styleMusic.common.white | 133 | objectName: "albums-albumartist" |
169 | 129 | elide: Text.ElideRight | 134 | text: artist |
170 | 130 | text: album | 135 | width: parent.width |
171 | 131 | fontSize: "small" | 136 | fontSize: "x-small" |
172 | 137 | elide: Text.ElideRight | ||
173 | 138 | color: styleMusic.nowPlaying.labelSecondaryColor | ||
174 | 139 | } | ||
175 | 140 | } | ||
176 | 132 | } | 141 | } |
177 | 133 | } | 142 | } |
178 | 134 | 143 | ||
179 | 135 | MouseArea { | 144 | MouseArea { |
180 | 136 | anchors.fill: parent | 145 | anchors.fill: parent |
181 | 137 | onDoubleClicked: { | ||
182 | 138 | } | ||
183 | 139 | onPressAndHold: { | ||
184 | 140 | } | ||
185 | 141 | onClicked: { | 146 | onClicked: { |
186 | 142 | albumTracksModel.filterAlbumTracks(album) | 147 | albumTracksModel.filterAlbumTracks(album) |
187 | 143 | mainpage.artist = artist | 148 | mainpage.artist = artist |
188 | @@ -156,112 +161,109 @@ | |||
189 | 156 | id: albumSheet | 161 | id: albumSheet |
190 | 157 | DefaultSheet { | 162 | DefaultSheet { |
191 | 158 | id: sheet | 163 | id: sheet |
193 | 159 | anchors.bottomMargin: units.gu(.5) | 164 | |
194 | 160 | doneButton: false | 165 | doneButton: false |
195 | 166 | anchors.bottomMargin: units.gu(0.5) | ||
196 | 161 | contentsHeight: parent.height | 167 | contentsHeight: parent.height |
197 | 162 | contentsWidth: parent.width | 168 | contentsWidth: parent.width |
198 | 163 | 169 | ||
199 | 164 | ListView { | 170 | ListView { |
200 | 171 | id: albumtrackslist | ||
201 | 172 | |||
202 | 165 | clip: true | 173 | clip: true |
207 | 166 | id: albumtrackslist | 174 | anchors.fill: parent |
208 | 167 | width: parent.width | 175 | anchors.margins: -units.gu(1) |
205 | 168 | anchors.top: parent.top | ||
206 | 169 | anchors.bottom: parent.bottom | ||
209 | 170 | model: albumTracksModel.model | 176 | model: albumTracksModel.model |
210 | 171 | delegate: albumTracksDelegate | 177 | delegate: albumTracksDelegate |
211 | 178 | |||
212 | 179 | onCountChanged: albumtrackslist.currentIndex = albumTracksModel.indexOf(currentFile) | ||
213 | 180 | |||
214 | 172 | header: ListItem.Standard { | 181 | header: ListItem.Standard { |
215 | 173 | id: albumInfo | 182 | id: albumInfo |
216 | 183 | |||
217 | 174 | width: parent.width | 184 | width: parent.width |
218 | 175 | height: units.gu(20) | 185 | height: units.gu(20) |
219 | 186 | showDivider: false | ||
220 | 176 | 187 | ||
221 | 177 | UbuntuShape { | 188 | UbuntuShape { |
222 | 178 | id: albumImage | 189 | id: albumImage |
227 | 179 | anchors.left: parent.left | 190 | |
228 | 180 | anchors.top: parent.top | 191 | anchors { |
229 | 181 | anchors.verticalCenter: parent.verticalCenter | 192 | top: parent.top |
230 | 182 | anchors.margins: units.gu(1) | 193 | bottom: parent.bottom |
231 | 194 | left: parent.left | ||
232 | 195 | margins: units.gu(2) | ||
233 | 196 | } | ||
234 | 197 | |||
235 | 198 | radius: "medium" | ||
236 | 183 | height: parent.height | 199 | height: parent.height |
237 | 184 | width: height | 200 | width: height |
238 | 185 | image: Image { | 201 | image: Image { |
239 | 186 | source: Library.hasCover(mainpage.file) ? mainpage.cover : Qt.resolvedUrl("images/cover_default.png") | 202 | source: Library.hasCover(mainpage.file) ? mainpage.cover : Qt.resolvedUrl("images/cover_default.png") |
240 | 187 | } | 203 | } |
241 | 188 | } | 204 | } |
272 | 189 | Label { | 205 | |
273 | 190 | id: albumArtist | 206 | Column { |
274 | 191 | objectName: "albumsheet-albumartist" | 207 | id: albumInfoColumn |
275 | 192 | wrapMode: Text.NoWrap | 208 | |
276 | 193 | maximumLineCount: 1 | 209 | anchors { |
277 | 194 | fontSize: "small" | 210 | top: albumImage.top |
278 | 195 | anchors.left: albumImage.right | 211 | left: albumImage.right |
279 | 196 | anchors.leftMargin: units.gu(1) | 212 | leftMargin: units.gu(1) |
280 | 197 | anchors.top: parent.top | 213 | } |
281 | 198 | anchors.topMargin: units.gu(1.5) | 214 | |
282 | 199 | anchors.right: parent.right | 215 | Label { |
283 | 200 | anchors.rightMargin: units.gu(1.5) | 216 | id: albumArtist |
284 | 201 | elide: Text.ElideRight | 217 | objectName: "albumsheet-albumartist" |
285 | 202 | text: mainpage.artist | 218 | fontSize: "small" |
286 | 203 | } | 219 | text: mainpage.artist |
287 | 204 | Label { | 220 | elide: Text.ElideRight |
288 | 205 | id: albumLabel | 221 | } |
289 | 206 | wrapMode: Text.NoWrap | 222 | |
290 | 207 | maximumLineCount: 2 | 223 | Label { |
291 | 208 | fontSize: "medium" | 224 | id: albumLabel |
292 | 209 | color: styleMusic.common.music | 225 | text: mainpage.album |
293 | 210 | anchors.left: albumImage.right | 226 | elide: Text.ElideRight |
294 | 211 | anchors.leftMargin: units.gu(1) | 227 | color: styleMusic.common.music |
295 | 212 | anchors.top: albumArtist.bottom | 228 | } |
296 | 213 | anchors.topMargin: units.gu(0.8) | 229 | } |
297 | 214 | anchors.right: parent.right | 230 | |
268 | 215 | anchors.rightMargin: units.gu(1.5) | ||
269 | 216 | elide: Text.ElideRight | ||
270 | 217 | text: mainpage.album | ||
271 | 218 | } | ||
298 | 219 | Label { | 231 | Label { |
299 | 220 | id: albumYear | 232 | id: albumYear |
302 | 221 | wrapMode: Text.NoWrap | 233 | anchors { |
303 | 222 | maximumLineCount: 1 | 234 | top: albumInfoColumn.bottom |
304 | 235 | left: albumInfoColumn.left | ||
305 | 236 | topMargin: units.gu(2) | ||
306 | 237 | } | ||
307 | 223 | fontSize: "x-small" | 238 | fontSize: "x-small" |
308 | 224 | anchors.left: albumImage.right | ||
309 | 225 | anchors.leftMargin: units.gu(1) | ||
310 | 226 | anchors.top: albumLabel.bottom | ||
311 | 227 | anchors.topMargin: units.gu(2) | ||
312 | 228 | anchors.right: parent.right | ||
313 | 229 | anchors.rightMargin: units.gu(1.5) | ||
314 | 230 | elide: Text.ElideRight | 239 | elide: Text.ElideRight |
315 | 231 | text: i18n.tr(mainpage.year + " | %1 song", mainpage.year + " | %1 songs", albumTracksModel.model.count).arg(albumTracksModel.model.count) | 240 | text: i18n.tr(mainpage.year + " | %1 song", mainpage.year + " | %1 songs", albumTracksModel.model.count).arg(albumTracksModel.model.count) |
316 | 232 | } | 241 | } |
317 | 233 | } | 242 | } |
318 | 234 | 243 | ||
319 | 235 | onCountChanged: { | ||
320 | 236 | albumtrackslist.currentIndex = albumTracksModel.indexOf(currentFile) | ||
321 | 237 | } | ||
322 | 238 | |||
323 | 239 | Component { | 244 | Component { |
324 | 240 | id: albumTracksDelegate | 245 | id: albumTracksDelegate |
325 | 241 | 246 | ||
326 | 242 | ListItem.Standard { | 247 | ListItem.Standard { |
327 | 243 | id: track | 248 | id: track |
328 | 244 | objectName: "albumsheet-track" | 249 | objectName: "albumsheet-track" |
329 | 250 | |||
330 | 245 | iconFrame: false | 251 | iconFrame: false |
331 | 246 | progression: false | 252 | progression: false |
332 | 247 | height: styleMusic.albums.itemHeight | 253 | height: styleMusic.albums.itemHeight |
333 | 248 | 254 | ||
334 | 249 | MouseArea { | 255 | MouseArea { |
335 | 250 | anchors.fill: parent | 256 | anchors.fill: parent |
336 | 251 | onDoubleClicked: { | ||
337 | 252 | } | ||
338 | 253 | onClicked: { | 257 | onClicked: { |
340 | 254 | if (focus == false) { | 258 | if (focus == false) |
341 | 255 | focus = true | 259 | focus = true |
342 | 256 | } | ||
343 | 257 | trackClicked(albumTracksModel, index) // play track | 260 | trackClicked(albumTracksModel, index) // play track |
344 | 258 | Library.addRecent(album, artist, cover, album, "album") | 261 | Library.addRecent(album, artist, cover, album, "album") |
345 | 259 | mainView.hasRecent = true | 262 | mainView.hasRecent = true |
346 | 260 | recentModel.filterRecent() | 263 | recentModel.filterRecent() |
347 | 261 | 264 | ||
351 | 262 | // TODO: This closes the SDK defined sheet | 265 | // TODO: This closes the SDK defined sheet component. It should be able to close |
352 | 263 | // component. It should be able to close | 266 | // albumSheet. |
350 | 264 | // albumSheet. | ||
353 | 265 | PopupUtils.close(sheet) | 267 | PopupUtils.close(sheet) |
354 | 266 | } | 268 | } |
355 | 267 | } | 269 | } |
356 | @@ -269,17 +271,14 @@ | |||
357 | 269 | Label { | 271 | Label { |
358 | 270 | id: trackTitle | 272 | id: trackTitle |
359 | 271 | objectName: "albumsheet-tracktitle" | 273 | objectName: "albumsheet-tracktitle" |
362 | 272 | wrapMode: Text.NoWrap | 274 | anchors { |
363 | 273 | maximumLineCount: 1 | 275 | top: parent.top |
364 | 276 | left: parent.left | ||
365 | 277 | right: expandItem.left | ||
366 | 278 | leftMargin: units.gu(2) | ||
367 | 279 | margins: units.gu(1) | ||
368 | 280 | } | ||
369 | 274 | fontSize: "medium" | 281 | fontSize: "medium" |
370 | 275 | anchors.left: parent.left | ||
371 | 276 | anchors.leftMargin: units.gu(2) | ||
372 | 277 | anchors.top: parent.top | ||
373 | 278 | anchors.topMargin: units.gu(1) | ||
374 | 279 | anchors.bottom: parent.bottom | ||
375 | 280 | anchors.bottomMargin: units.gu(1) | ||
376 | 281 | anchors.right: expandItem.left | ||
377 | 282 | anchors.rightMargin: units.gu(1.5) | ||
378 | 283 | elide: Text.ElideRight | 282 | elide: Text.ElideRight |
379 | 284 | text: model.title | 283 | text: model.title |
380 | 285 | } | 284 | } |
381 | @@ -287,48 +286,47 @@ | |||
382 | 287 | Image { | 286 | Image { |
383 | 288 | id: expandItem | 287 | id: expandItem |
384 | 289 | objectName: "albumsheet-expanditem" | 288 | objectName: "albumsheet-expanditem" |
387 | 290 | anchors.right: parent.right | 289 | |
388 | 291 | anchors.rightMargin: units.gu(2) | 290 | anchors { |
389 | 291 | verticalCenter: trackTitle.verticalCenter | ||
390 | 292 | right: parent.right | ||
391 | 293 | rightMargin: units.gu(2) | ||
392 | 294 | } | ||
393 | 292 | source: expandable.visible ? "images/dropdown-menu-up.svg" : "images/dropdown-menu.svg" | 295 | source: expandable.visible ? "images/dropdown-menu-up.svg" : "images/dropdown-menu.svg" |
394 | 293 | height: styleMusic.common.expandedItem | 296 | height: styleMusic.common.expandedItem |
395 | 294 | width: styleMusic.common.expandedItem | 297 | width: styleMusic.common.expandedItem |
397 | 295 | y: parent.y + (styleMusic.albums.itemHeight / 2) - (height / 2) | 298 | |
398 | 299 | MouseArea { | ||
399 | 300 | anchors.centerIn: parent | ||
400 | 301 | width: styleMusic.common.expandedItem * 3 | ||
401 | 302 | height: styleMusic.common.expandedItem * 2 | ||
402 | 303 | onClicked: { | ||
403 | 304 | if(expandable.visible) { | ||
404 | 305 | customdebug("clicked collapse") | ||
405 | 306 | expandable.visible = false | ||
406 | 307 | track.height = styleMusic.albums.itemHeight | ||
407 | 308 | } | ||
408 | 309 | else { | ||
409 | 310 | customdebug("clicked expand") | ||
410 | 311 | collapseExpand(-1); // collapse all others | ||
411 | 312 | expandable.visible = true | ||
412 | 313 | track.height = styleMusic.albums.expandedHeight | ||
413 | 314 | } | ||
414 | 315 | } | ||
415 | 316 | } | ||
416 | 296 | } | 317 | } |
417 | 297 | 318 | ||
439 | 298 | MouseArea { | 319 | Item { |
419 | 299 | anchors.bottom: parent.bottom | ||
420 | 300 | anchors.right: parent.right | ||
421 | 301 | anchors.top: parent.top | ||
422 | 302 | width: styleMusic.common.expandedItem * 3 | ||
423 | 303 | onClicked: { | ||
424 | 304 | if(expandable.visible) { | ||
425 | 305 | customdebug("clicked collapse") | ||
426 | 306 | expandable.visible = false | ||
427 | 307 | track.height = styleMusic.albums.itemHeight | ||
428 | 308 | } | ||
429 | 309 | else { | ||
430 | 310 | customdebug("clicked expand") | ||
431 | 311 | collapseExpand(-1); // collapse all others | ||
432 | 312 | expandable.visible = true | ||
433 | 313 | track.height = styleMusic.albums.expandedHeight | ||
434 | 314 | } | ||
435 | 315 | } | ||
436 | 316 | } | ||
437 | 317 | |||
438 | 318 | Rectangle { | ||
440 | 319 | id: expandable | 320 | id: expandable |
442 | 320 | color: "transparent" | 321 | |
443 | 322 | visible: false | ||
444 | 321 | height: styleMusic.albums.expandHeight | 323 | height: styleMusic.albums.expandHeight |
446 | 322 | visible: false | 324 | |
447 | 325 | Component.onCompleted: collapseExpand.connect(onCollapseExpand); | ||
448 | 326 | |||
449 | 323 | MouseArea { | 327 | MouseArea { |
458 | 324 | anchors.fill: parent | 328 | anchors.fill: parent |
459 | 325 | onClicked: { | 329 | onClicked: customdebug("User pressed outside the playlist item and expanded items.") |
452 | 326 | customdebug("User pressed outside the playlist item and expanded items.") | ||
453 | 327 | } | ||
454 | 328 | } | ||
455 | 329 | |||
456 | 330 | Component.onCompleted: { | ||
457 | 331 | collapseExpand.connect(onCollapseExpand); | ||
460 | 332 | } | 330 | } |
461 | 333 | 331 | ||
462 | 334 | function onCollapseExpand(indexCol) | 332 | function onCollapseExpand(indexCol) |
463 | @@ -341,108 +339,73 @@ | |||
464 | 341 | } | 339 | } |
465 | 342 | } | 340 | } |
466 | 343 | 341 | ||
468 | 344 | // background for expander | 342 | // Background for expander |
469 | 345 | Rectangle { | 343 | Rectangle { |
470 | 346 | id: expandedBackground | 344 | id: expandedBackground |
473 | 347 | anchors.top: parent.top | 345 | |
474 | 348 | anchors.topMargin: styleMusic.albums.itemHeight | 346 | anchors { |
475 | 347 | top: parent.top | ||
476 | 348 | topMargin: styleMusic.albums.itemHeight | ||
477 | 349 | } | ||
478 | 350 | |||
479 | 351 | opacity: 0.4 | ||
480 | 352 | width: track.width | ||
481 | 349 | color: styleMusic.common.black | 353 | color: styleMusic.common.black |
482 | 350 | height: styleMusic.albums.expandedHeight - styleMusic.albums.itemHeight | 354 | height: styleMusic.albums.expandedHeight - styleMusic.albums.itemHeight |
578 | 351 | width: track.width | 355 | |
579 | 352 | opacity: 0.4 | 356 | Row { |
580 | 353 | } | 357 | id: trackOptionsRow |
581 | 354 | 358 | ||
582 | 355 | // add to playlist | 359 | anchors { |
583 | 356 | Rectangle { | 360 | verticalCenter: parent.verticalCenter |
584 | 357 | id: playlistRow | 361 | left: parent.left |
585 | 358 | anchors.top: expandedBackground.top | 362 | right: parent.right |
586 | 359 | anchors.left: parent.left | 363 | leftMargin: styleMusic.albums.expandedLeftMargin |
587 | 360 | anchors.leftMargin: styleMusic.albums.expandedLeftMargin | 364 | } |
588 | 361 | color: "transparent" | 365 | |
589 | 362 | height: expandedBackground.height | 366 | spacing: styleMusic.albums.expandedLeftMargin |
590 | 363 | width: units.gu(15) | 367 | |
591 | 364 | Icon { | 368 | ImageButton { |
592 | 365 | id: playlistTrack | 369 | id: addToPlaylistButton |
593 | 366 | anchors.verticalCenter: parent.verticalCenter | 370 | |
594 | 367 | color: styleMusic.common.white | 371 | icon.name: "add" |
595 | 368 | name: "add" | 372 | icon.width: styleMusic.common.expandedItem |
596 | 369 | height: styleMusic.common.expandedItem | 373 | label.text: i18n.tr("Add to playlist") |
597 | 370 | width: styleMusic.common.expandedItem | 374 | label.anchors.verticalCenter: icon.verticalCenter |
598 | 371 | } | 375 | |
599 | 372 | Label { | 376 | onClicked: { |
600 | 373 | anchors.left: playlistTrack.right | 377 | expandable.visible = false |
601 | 374 | anchors.leftMargin: units.gu(0.5) | 378 | track.height = styleMusic.albums.itemHeight |
602 | 375 | anchors.verticalCenter: parent.verticalCenter | 379 | chosenArtist = artist |
603 | 376 | color: styleMusic.common.white | 380 | chosenTitle = title |
604 | 377 | fontSize: "small" | 381 | chosenTrack = file |
605 | 378 | width: parent.width - playlistTrack.width - units.gu(1) | 382 | chosenAlbum = album |
606 | 379 | text: i18n.tr("Add to playlist") | 383 | chosenCover = cover |
607 | 380 | wrapMode: Text.WordWrap | 384 | chosenGenre = genre |
608 | 381 | maximumLineCount: 3 | 385 | chosenIndex = index |
609 | 382 | } | 386 | console.debug("Debug: Add track to playlist") |
610 | 383 | MouseArea { | 387 | PopupUtils.open(Qt.resolvedUrl("MusicaddtoPlaylist.qml"), mainView, { title: i18n.tr("Select playlist") }) |
611 | 384 | anchors.fill: parent | 388 | } |
612 | 385 | onClicked: { | 389 | } |
613 | 386 | expandable.visible = false | 390 | |
614 | 387 | track.height = styleMusic.albums.itemHeight | 391 | ImageButton { |
615 | 388 | chosenArtist = artist | 392 | id: addToQueueButton |
616 | 389 | chosenTitle = title | 393 | objectName: "albumsheet-queuetrack" |
617 | 390 | chosenTrack = file | 394 | |
618 | 391 | chosenAlbum = album | 395 | image.source: Qt.resolvedUrl("images/queue.png") |
619 | 392 | chosenCover = cover | 396 | image.width: styleMusic.common.expandedItem |
620 | 393 | chosenGenre = genre | 397 | label.text: i18n.tr("Add to queue") |
621 | 394 | chosenIndex = index | 398 | label.anchors.verticalCenter: image.verticalCenter |
622 | 395 | console.debug("Debug: Add track to playlist") | 399 | |
623 | 396 | PopupUtils.open(Qt.resolvedUrl("MusicaddtoPlaylist.qml"), mainView, | 400 | onClicked: { |
624 | 397 | { | 401 | expandable.visible = false |
625 | 398 | title: i18n.tr("Select playlist") | 402 | track.height = styleMusic.albums.itemHeight |
626 | 399 | } ) | 403 | console.debug("Debug: Add track to queue: " + title) |
627 | 400 | } | 404 | trackQueue.model.append({"title": title, "artist": artist, "file": file, "album": album, "cover": cover, "genre": genre}) |
628 | 401 | } | 405 | } |
629 | 402 | } | 406 | } |
630 | 403 | // Queue | 407 | } |
631 | 404 | Rectangle { | 408 | } |
537 | 405 | id: queueRow | ||
538 | 406 | anchors.top: expandedBackground.top | ||
539 | 407 | anchors.left: playlistRow.left | ||
540 | 408 | anchors.leftMargin: units.gu(15) | ||
541 | 409 | color: "transparent" | ||
542 | 410 | height: expandedBackground.height | ||
543 | 411 | width: units.gu(15) | ||
544 | 412 | Image { | ||
545 | 413 | id: queueTrack | ||
546 | 414 | objectName: "albumsheet-queuetrack" | ||
547 | 415 | anchors.verticalCenter: parent.verticalCenter | ||
548 | 416 | source: "images/queue.png" | ||
549 | 417 | height: styleMusic.common.expandedItem | ||
550 | 418 | width: styleMusic.common.expandedItem | ||
551 | 419 | } | ||
552 | 420 | Label { | ||
553 | 421 | anchors.left: queueTrack.right | ||
554 | 422 | anchors.leftMargin: units.gu(0.5) | ||
555 | 423 | anchors.verticalCenter: parent.verticalCenter | ||
556 | 424 | color: styleMusic.common.white | ||
557 | 425 | fontSize: "small" | ||
558 | 426 | width: parent.width - queueTrack.width - units.gu(1) | ||
559 | 427 | text: i18n.tr("Add to queue") | ||
560 | 428 | wrapMode: Text.WordWrap | ||
561 | 429 | maximumLineCount: 3 | ||
562 | 430 | } | ||
563 | 431 | MouseArea { | ||
564 | 432 | anchors.fill: parent | ||
565 | 433 | onClicked: { | ||
566 | 434 | expandable.visible = false | ||
567 | 435 | track.height = styleMusic.albums.itemHeight | ||
568 | 436 | console.debug("Debug: Add track to queue: " + title) | ||
569 | 437 | trackQueue.model.append({"title": title, "artist": artist, "file": file, "album": album, "cover": cover, "genre": genre}) | ||
570 | 438 | } | ||
571 | 439 | } | ||
572 | 440 | } | ||
573 | 441 | } | ||
574 | 442 | |||
575 | 443 | onFocusChanged: { | ||
576 | 444 | } | ||
577 | 445 | Component.onCompleted: { | ||
632 | 446 | } | 409 | } |
633 | 447 | } | 410 | } |
634 | 448 | } | 411 | } |
635 | @@ -450,5 +413,3 @@ | |||
636 | 450 | } | 413 | } |
637 | 451 | } | 414 | } |
638 | 452 | } | 415 | } |
639 | 453 | |||
640 | 454 | |||
641 | 455 | 416 | ||
642 | === modified file 'MusicArtists.qml' | |||
643 | --- MusicArtists.qml 2013-12-23 22:53:59 +0000 | |||
644 | +++ MusicArtists.qml 2014-01-09 14:17:52 +0000 | |||
645 | @@ -70,6 +70,7 @@ | |||
646 | 70 | anchors.leftMargin: units.gu(4) | 70 | anchors.leftMargin: units.gu(4) |
647 | 71 | anchors.top: parent.top | 71 | anchors.top: parent.top |
648 | 72 | anchors.topMargin: units.gu(1) | 72 | anchors.topMargin: units.gu(1) |
649 | 73 | radius: "medium" | ||
650 | 73 | width: styleMusic.common.albumSize | 74 | width: styleMusic.common.albumSize |
651 | 74 | height: styleMusic.common.albumSize | 75 | height: styleMusic.common.albumSize |
652 | 75 | image: Image { | 76 | image: Image { |
653 | @@ -83,6 +84,7 @@ | |||
654 | 83 | anchors.leftMargin: units.gu(3) | 84 | anchors.leftMargin: units.gu(3) |
655 | 84 | anchors.top: parent.top | 85 | anchors.top: parent.top |
656 | 85 | anchors.topMargin: units.gu(1) | 86 | anchors.topMargin: units.gu(1) |
657 | 87 | radius: "medium" | ||
658 | 86 | width: styleMusic.common.albumSize | 88 | width: styleMusic.common.albumSize |
659 | 87 | height: styleMusic.common.albumSize | 89 | height: styleMusic.common.albumSize |
660 | 88 | image: Image { | 90 | image: Image { |
661 | @@ -96,6 +98,7 @@ | |||
662 | 96 | anchors.leftMargin: units.gu(2) | 98 | anchors.leftMargin: units.gu(2) |
663 | 97 | anchors.top: parent.top | 99 | anchors.top: parent.top |
664 | 98 | anchors.topMargin: units.gu(1) | 100 | anchors.topMargin: units.gu(1) |
665 | 101 | radius: "medium" | ||
666 | 99 | width: styleMusic.common.albumSize | 102 | width: styleMusic.common.albumSize |
667 | 100 | height: styleMusic.common.albumSize | 103 | height: styleMusic.common.albumSize |
668 | 101 | image: Image { | 104 | image: Image { |
669 | @@ -109,6 +112,7 @@ | |||
670 | 109 | anchors.leftMargin: units.gu(1) | 112 | anchors.leftMargin: units.gu(1) |
671 | 110 | anchors.top: parent.top | 113 | anchors.top: parent.top |
672 | 111 | anchors.topMargin: units.gu(1) | 114 | anchors.topMargin: units.gu(1) |
673 | 115 | radius: "medium" | ||
674 | 112 | width: styleMusic.common.albumSize | 116 | width: styleMusic.common.albumSize |
675 | 113 | height: styleMusic.common.albumSize | 117 | height: styleMusic.common.albumSize |
676 | 114 | image: Image { | 118 | image: Image { |
677 | @@ -220,6 +224,7 @@ | |||
678 | 220 | anchors.margins: units.gu(2) | 224 | anchors.margins: units.gu(2) |
679 | 221 | height: parent.height | 225 | height: parent.height |
680 | 222 | width: height | 226 | width: height |
681 | 227 | radius: "medium" | ||
682 | 223 | image: Image { | 228 | image: Image { |
683 | 224 | source: artisttrackslist.cover !== "" ? artisttrackslist.cover : "images/cover_default.png" | 229 | source: artisttrackslist.cover !== "" ? artisttrackslist.cover : "images/cover_default.png" |
684 | 225 | } | 230 | } |
685 | @@ -298,6 +303,7 @@ | |||
686 | 298 | anchors.leftMargin: units.gu(2) | 303 | anchors.leftMargin: units.gu(2) |
687 | 299 | anchors.top: parent.top | 304 | anchors.top: parent.top |
688 | 300 | anchors.topMargin: units.gu(1) | 305 | anchors.topMargin: units.gu(1) |
689 | 306 | radius: "medium" | ||
690 | 301 | width: styleMusic.common.albumSize | 307 | width: styleMusic.common.albumSize |
691 | 302 | height: styleMusic.common.albumSize | 308 | height: styleMusic.common.albumSize |
692 | 303 | image: Image { | 309 | image: Image { |
693 | 304 | 310 | ||
694 | === modified file 'MusicNowPlaying.qml' | |||
695 | --- MusicNowPlaying.qml 2013-12-23 22:53:59 +0000 | |||
696 | +++ MusicNowPlaying.qml 2014-01-09 14:17:52 +0000 | |||
697 | @@ -528,6 +528,7 @@ | |||
698 | 528 | anchors.left: parent.left | 528 | anchors.left: parent.left |
699 | 529 | anchors.leftMargin: units.gu(1.5) | 529 | anchors.leftMargin: units.gu(1.5) |
700 | 530 | anchors.top: parent.top | 530 | anchors.top: parent.top |
701 | 531 | radius: "medium" | ||
702 | 531 | height: (queueListItem.state === "current" ? queuelist.currentHeight - units.gu(8) : queuelist.normalHeight) - units.gu(2) | 532 | height: (queueListItem.state === "current" ? queuelist.currentHeight - units.gu(8) : queuelist.normalHeight) - units.gu(2) |
703 | 532 | width: height | 533 | width: height |
704 | 533 | image: Image { | 534 | image: Image { |
705 | 534 | 535 | ||
706 | === modified file 'MusicPlaylists.qml' | |||
707 | --- MusicPlaylists.qml 2014-01-09 00:43:35 +0000 | |||
708 | +++ MusicPlaylists.qml 2014-01-09 14:17:52 +0000 | |||
709 | @@ -492,6 +492,7 @@ | |||
710 | 492 | 492 | ||
711 | 493 | Label { | 493 | Label { |
712 | 494 | id: playlistInfoCount | 494 | id: playlistInfoCount |
713 | 495 | |||
714 | 495 | anchors { | 496 | anchors { |
715 | 496 | top: playlistInfoLabel.bottom | 497 | top: playlistInfoLabel.bottom |
716 | 497 | left: playlistInfoLabel.left | 498 | left: playlistInfoLabel.left |
717 | @@ -499,7 +500,7 @@ | |||
718 | 499 | topMargin: units.gu(1) | 500 | topMargin: units.gu(1) |
719 | 500 | rightMargin: units.gu(1.5) | 501 | rightMargin: units.gu(1.5) |
720 | 501 | } | 502 | } |
722 | 502 | text: i18n.tr("%1 song", "%1 songs", playlist.count).arg(playlist.count) | 503 | text: i18n.tr("%1 song", "%1 songs", playlistInfo.count).arg(playlistInfo.count) |
723 | 503 | color: styleMusic.common.white | 504 | color: styleMusic.common.white |
724 | 504 | fontSize: "medium" | 505 | fontSize: "medium" |
725 | 505 | elide: Text.ElideRight | 506 | elide: Text.ElideRight |
726 | @@ -1022,6 +1023,7 @@ | |||
727 | 1022 | anchors.leftMargin: units.gu(1) | 1023 | anchors.leftMargin: units.gu(1) |
728 | 1023 | anchors.top: parent.top | 1024 | anchors.top: parent.top |
729 | 1024 | anchors.verticalCenter: parent.verticalCenter | 1025 | anchors.verticalCenter: parent.verticalCenter |
730 | 1026 | radius: "medium" | ||
731 | 1025 | width: styleMusic.common.albumSize | 1027 | width: styleMusic.common.albumSize |
732 | 1026 | height: styleMusic.common.albumSize | 1028 | height: styleMusic.common.albumSize |
733 | 1027 | image: Image { | 1029 | image: Image { |
734 | @@ -1030,6 +1032,7 @@ | |||
735 | 1030 | UbuntuShape { // Background so can see text in current state | 1032 | UbuntuShape { // Background so can see text in current state |
736 | 1031 | id: trackBg | 1033 | id: trackBg |
737 | 1032 | anchors.top: parent.top | 1034 | anchors.top: parent.top |
738 | 1035 | radius: "medium" | ||
739 | 1033 | color: styleMusic.common.black | 1036 | color: styleMusic.common.black |
740 | 1034 | width: styleMusic.common.albumSize | 1037 | width: styleMusic.common.albumSize |
741 | 1035 | height: styleMusic.common.albumSize | 1038 | height: styleMusic.common.albumSize |
742 | 1036 | 1039 | ||
743 | === modified file 'MusicStart.qml' | |||
744 | --- MusicStart.qml 2013-12-19 14:39:27 +0000 | |||
745 | +++ MusicStart.qml 2014-01-09 14:17:52 +0000 | |||
746 | @@ -104,6 +104,7 @@ | |||
747 | 104 | id: recentShape | 104 | id: recentShape |
748 | 105 | height: recentItem.width | 105 | height: recentItem.width |
749 | 106 | width: recentItem.width | 106 | width: recentItem.width |
750 | 107 | radius: "medium" | ||
751 | 107 | image: Image { | 108 | image: Image { |
752 | 108 | id: icon | 109 | id: icon |
753 | 109 | fillMode: Image.Stretch | 110 | fillMode: Image.Stretch |
754 | @@ -119,6 +120,7 @@ | |||
755 | 119 | UbuntuShape { // Background so can see text in current state | 120 | UbuntuShape { // Background so can see text in current state |
756 | 120 | id: albumBg2 | 121 | id: albumBg2 |
757 | 121 | anchors.bottom: parent.bottom | 122 | anchors.bottom: parent.bottom |
758 | 123 | radius: "medium" | ||
759 | 122 | color: styleMusic.common.black | 124 | color: styleMusic.common.black |
760 | 123 | height: units.gu(4) | 125 | height: units.gu(4) |
761 | 124 | width: parent.width | 126 | width: parent.width |
762 | @@ -228,6 +230,7 @@ | |||
763 | 228 | id: genreShape | 230 | id: genreShape |
764 | 229 | height: genreItem.width | 231 | height: genreItem.width |
765 | 230 | width: genreItem.width | 232 | width: genreItem.width |
766 | 233 | radius: "medium" | ||
767 | 231 | image: Image { | 234 | image: Image { |
768 | 232 | id: icon | 235 | id: icon |
769 | 233 | fillMode: Image.Stretch | 236 | fillMode: Image.Stretch |
770 | @@ -272,6 +275,7 @@ | |||
771 | 272 | UbuntuShape { // Background so can see text in current state | 275 | UbuntuShape { // Background so can see text in current state |
772 | 273 | id: genreBg2 | 276 | id: genreBg2 |
773 | 274 | anchors.bottom: parent.bottom | 277 | anchors.bottom: parent.bottom |
774 | 278 | radius: "medium" | ||
775 | 275 | color: styleMusic.common.black | 279 | color: styleMusic.common.black |
776 | 276 | height: units.gu(4) | 280 | height: units.gu(4) |
777 | 277 | width: parent.width | 281 | width: parent.width |
778 | 278 | 282 | ||
779 | === modified file 'MusicTracks.qml' | |||
780 | --- MusicTracks.qml 2014-01-06 18:08:52 +0000 | |||
781 | +++ MusicTracks.qml 2014-01-09 14:17:52 +0000 | |||
782 | @@ -73,6 +73,7 @@ | |||
783 | 73 | anchors.leftMargin: units.gu(2) | 73 | anchors.leftMargin: units.gu(2) |
784 | 74 | anchors.top: parent.top | 74 | anchors.top: parent.top |
785 | 75 | anchors.topMargin: units.gu(1) | 75 | anchors.topMargin: units.gu(1) |
786 | 76 | radius: "medium" | ||
787 | 76 | width: styleMusic.common.albumSize | 77 | width: styleMusic.common.albumSize |
788 | 77 | height: styleMusic.common.albumSize | 78 | height: styleMusic.common.albumSize |
789 | 78 | image: Image { | 79 | image: Image { |
790 | 79 | 80 | ||
791 | === added file 'common/ImageButton.qml' | |||
792 | --- common/ImageButton.qml 1970-01-01 00:00:00 +0000 | |||
793 | +++ common/ImageButton.qml 2014-01-09 14:17:52 +0000 | |||
794 | @@ -0,0 +1,63 @@ | |||
795 | 1 | /* | ||
796 | 2 | * Copyright (C) 2013 Canonical Ltd | ||
797 | 3 | * | ||
798 | 4 | * This program is free software: you can redistribute it and/or modify | ||
799 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
800 | 6 | * published by the Free Software Foundation. | ||
801 | 7 | * | ||
802 | 8 | * This program is distributed in the hope that it will be useful, | ||
803 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
804 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
805 | 11 | * GNU General Public License for more details. | ||
806 | 12 | * | ||
807 | 13 | * You should have received a copy of the GNU General Public License | ||
808 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
809 | 15 | * | ||
810 | 16 | * Authored by: Nekhelesh Ramananthan <krnekhelesh@gmail.com> | ||
811 | 17 | */ | ||
812 | 18 | |||
813 | 19 | import QtQuick 2.0 | ||
814 | 20 | import Ubuntu.Components 0.1 | ||
815 | 21 | |||
816 | 22 | // Qml Item to draw a button with an image on its left/right | ||
817 | 23 | AbstractButton { | ||
818 | 24 | id: imageButton | ||
819 | 25 | |||
820 | 26 | // Set the button label and image | ||
821 | 27 | property alias label: _label | ||
822 | 28 | property alias image: _image | ||
823 | 29 | property alias icon: _icon | ||
824 | 30 | |||
825 | 31 | // Property to mirror the button layout if necessary. Image on the left by default. | ||
826 | 32 | property bool mirrorLayout: false; | ||
827 | 33 | |||
828 | 34 | width: childrenRect.width; | ||
829 | 35 | height: childrenRect.height; | ||
830 | 36 | |||
831 | 37 | Row { | ||
832 | 38 | spacing: units.gu(1); | ||
833 | 39 | height: childrenRect.height; | ||
834 | 40 | LayoutMirroring.enabled: mirrorLayout | ||
835 | 41 | |||
836 | 42 | Icon { | ||
837 | 43 | id: _icon | ||
838 | 44 | name: "" | ||
839 | 45 | height: width | ||
840 | 46 | color: styleMusic.common.white | ||
841 | 47 | visible: name === "" ? false : true | ||
842 | 48 | } | ||
843 | 49 | |||
844 | 50 | Image { | ||
845 | 51 | id: _image | ||
846 | 52 | source: "" | ||
847 | 53 | height: width | ||
848 | 54 | visible: source === "" ? false : true | ||
849 | 55 | } | ||
850 | 56 | |||
851 | 57 | Label { | ||
852 | 58 | id: _label | ||
853 | 59 | fontSize: "small" | ||
854 | 60 | color: styleMusic.common.white | ||
855 | 61 | } | ||
856 | 62 | } | ||
857 | 63 | } |
FAILED: Continuous integration, rev:302 91.189. 93.70:8080/ job/music- app-ci/ 433/ 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 612 91.189. 93.70:8080/ job/music- app-raring- amd64-ci/ 433 91.189. 93.70:8080/ job/music- app-saucy- amd64-ci/ 435 91.189. 93.70:8080/ job/music- app-trusty- amd64-ci/ 154
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/music- app-ci/ 433/rebuild
http://