~carla-sella/music-app/show_albums_sheet

29.2.1 by Daniel Holm
Beginning of Lucas' design ideas (0.04); back to tabs and start of scobble
1
/*
2
 * Copyright (C) 2013 Victor Thompson <victor.thompson@gmail.com>
3
 *                    Daniel Holm <d.holmen@gmail.com>
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation; version 3.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
 */
17
18
import QtQuick 2.0
19
import Ubuntu.Components 0.1
20
import Ubuntu.Components.ListItems 0.1
21
import Ubuntu.Components.Popups 0.1
22
import Ubuntu.Components.ListItems 0.1 as ListItem
23
import QtMultimedia 5.0
24
import QtQuick.LocalStorage 2.0
105.4.5 by Victor Thompson
Add background to sheet and made BlurredBackground a common component
25
import QtGraphicalEffects 1.0
29.2.1 by Daniel Holm
Beginning of Lucas' design ideas (0.04); back to tabs and start of scobble
26
import "settings.js" as Settings
27
import "meta-database.js" as Library
55.3.1 by Daniel Holm
Show tracks in playlist; click on track to play it.
28
import "playlists.js" as Playlists
105.4.5 by Victor Thompson
Add background to sheet and made BlurredBackground a common component
29
import "common"
55.3.1 by Daniel Holm
Show tracks in playlist; click on track to play it.
30
105.4.1 by Victor Thompson
Initial album sheet
31
Page {
32
    id: mainpage
33
    title: i18n.tr("Albums")
34
35
    property string artist: ""
36
    property string album: ""
37
    property string songtitle: ""
38
    property string cover: ""
39
    property string length: ""
40
    property string file: ""
41
    property string year: ""
42
255.1.1 by Victor Thompson
Set current music toolbar's current page when Albums tab is made visible again
43
    onVisibleChanged: {
44
        if (visible === true)
45
        {
46
            musicToolbar.setPage(mainpage);
47
        }
48
    }
49
100.2.1 by Daniel Holm
Inital move of settings to a Sheet and added the new stuff.
50
    MusicSettings {
51
        id: musicSettings
52
    }
53
105.4.1 by Victor Thompson
Initial album sheet
54
    GridView {
55
        id: albumlist
133.1.17 by Andrew Hayzen
* Merge of trunk
56
        anchors.fill: parent
175.3.1 by Andrew Hayzen
* Fix to add margins to the album page
57
        anchors.leftMargin: units.gu(1)
58
        anchors.topMargin: units.gu(1)
240.1.2 by Victor Thompson
Make cover art bigger, so it is more apparent that scrolling is horizontal.
59
        anchors.bottomMargin: units.gu(1)
60
        cellHeight: (parent.height - units.gu(2))/3
61
        cellWidth: (parent.height - units.gu(2))/3
105.4.1 by Victor Thompson
Initial album sheet
62
        model: albumModel.model
63
        delegate: albumDelegate
240.1.1 by Victor Thompson
Make Albums tab scroll left to right.
64
        flow: GridView.TopToBottom
105.4.1 by Victor Thompson
Initial album sheet
65
66
        Component {
67
            id: albumDelegate
68
            Item {
69
                id: albumItem
240.1.1 by Victor Thompson
Make Albums tab scroll left to right.
70
                height: albumlist.cellHeight - units.gu(1)
71
                width: albumlist.cellHeight - units.gu(1)
105.4.1 by Victor Thompson
Initial album sheet
72
                anchors.margins: units.gu(1)
85.1.1 by Victor Thompson
Initial album view per new design spec.
73
                UbuntuShape {
105.4.1 by Victor Thompson
Initial album sheet
74
                    id: albumShape
75
                    height: albumItem.width
76
                    width: albumItem.width
85.1.1 by Victor Thompson
Initial album view per new design spec.
77
                    image: Image {
105.4.1 by Victor Thompson
Initial album sheet
78
                        id: icon
79
                        fillMode: Image.Stretch
105.4.2 by Victor Thompson
Merge with trunk and updates to album sheet
80
                        property string artist: model.artist
81
                        property string album: model.album
82
                        property string title: model.title
83
                        property string cover: model.cover
84
                        property string length: model.length
85
                        property string file: model.file
86
                        property string year: model.year
87
                        source: cover !== "" ? cover : "images/cover_default.png"
88
                    }
240.3.1 by Victor Thompson
Fix album art rounding on bottom corners with solid labels
89
                    UbuntuShape {  // Background so can see text in current state
90
                        id: albumBg2
91
                        anchors.bottom: parent.bottom
92
                        color: styleMusic.common.black
93
                        height: units.gu(4)
94
                        width: parent.width
95
                    }
217.1.1 by Victor Thompson
Make transparent labels on cover art solid and overlap.
96
                    Rectangle {  // Background so can see text in current state
97
                        id: albumBg
98
                        anchors.bottom: parent.bottom
240.3.1 by Victor Thompson
Fix album art rounding on bottom corners with solid labels
99
                        anchors.bottomMargin: units.gu(2)
100
                        color: styleMusic.common.black
101
                        height: units.gu(3)
102
                        width: parent.width
103
                    }
104
                    Label {
105
                        id: albumArtist
259 by carla.sella at gmail
Added test_show_albums_sheet.
106
                        objectName: "albums-albumartist"
240.3.1 by Victor Thompson
Fix album art rounding on bottom corners with solid labels
107
                        anchors.bottom: parent.bottom
108
                        anchors.bottomMargin: units.gu(1)
109
                        anchors.left: parent.left
110
                        anchors.leftMargin: units.gu(.25)
111
                        anchors.right: parent.right
112
                        anchors.rightMargin: units.gu(.25)
113
                        horizontalAlignment: Text.AlignHCenter
114
                        color: styleMusic.nowPlaying.labelSecondaryColor
115
                        elide: Text.ElideRight
116
                        text: artist
117
                        fontSize: "x-small"
118
                    }
119
                    Label {
120
                        id: albumLabel
121
                        anchors.bottom: parent.bottom
122
                        anchors.bottomMargin: units.gu(3)
123
                        anchors.left: parent.left
124
                        anchors.leftMargin: units.gu(.25)
125
                        anchors.right: parent.right
126
                        anchors.rightMargin: units.gu(.25)
127
                        horizontalAlignment: Text.AlignHCenter
128
                        color: styleMusic.common.white
129
                        elide: Text.ElideRight
130
                        text: album
131
                        fontSize: "small"
217.1.1 by Victor Thompson
Make transparent labels on cover art solid and overlap.
132
                    }
85.1.1 by Victor Thompson
Initial album view per new design spec.
133
                }
105.4.1 by Victor Thompson
Initial album sheet
134
135
                MouseArea {
136
                    anchors.fill: parent
137
                    onDoubleClicked: {
138
                    }
139
                    onPressAndHold: {
140
                    }
141
                    onClicked: {
142
                        albumTracksModel.filterAlbumTracks(album)
105.4.2 by Victor Thompson
Merge with trunk and updates to album sheet
143
                        mainpage.artist = artist
144
                        mainpage.album = album
145
                        mainpage.file = file
146
                        mainpage.year = year
147
                        mainpage.cover = cover
105.4.1 by Victor Thompson
Initial album sheet
148
                        PopupUtils.open(albumSheet)
149
                    }
141.1.7 by Daniel Holm
More changes: new sizes for items in album.
150
                }
151
            }
105.4.1 by Victor Thompson
Initial album sheet
152
        }
153
    }
154
155
    Component {
156
        id: albumSheet
157
        DefaultSheet {
158
            id: sheet
105.4.3 by Victor Thompson
Show bottom progress bar.
159
            anchors.bottomMargin: units.gu(.5)
105.4.2 by Victor Thompson
Merge with trunk and updates to album sheet
160
            doneButton: false
105.4.1 by Victor Thompson
Initial album sheet
161
            contentsHeight: parent.height
105.4.5 by Victor Thompson
Add background to sheet and made BlurredBackground a common component
162
            contentsWidth: parent.width
163
105.4.1 by Victor Thompson
Initial album sheet
164
            ListView {
105.4.2 by Victor Thompson
Merge with trunk and updates to album sheet
165
                clip: true
105.4.1 by Victor Thompson
Initial album sheet
166
                id: albumtrackslist
141.1.7 by Daniel Holm
More changes: new sizes for items in album.
167
                width: parent.width
105.4.1 by Victor Thompson
Initial album sheet
168
                anchors.top: parent.top
169
                anchors.bottom: parent.bottom
170
                model: albumTracksModel.model
171
                delegate: albumTracksDelegate
172
                header: ListItem.Standard {
173
                    id: albumInfo
174
                    width: parent.width
175
                    height: units.gu(20)
133.1.17 by Andrew Hayzen
* Merge of trunk
176
105.4.1 by Victor Thompson
Initial album sheet
177
                    UbuntuShape {
178
                        id: albumImage
82.1.1 by Victor Thompson
Prevent the ListView from jumping around when current item is being played.
179
                        anchors.left: parent.left
105.4.1 by Victor Thompson
Initial album sheet
180
                        anchors.top: parent.top
181
                        anchors.verticalCenter: parent.verticalCenter
182
                        anchors.margins: units.gu(1)
82.1.1 by Victor Thompson
Prevent the ListView from jumping around when current item is being played.
183
                        height: parent.height
105.4.1 by Victor Thompson
Initial album sheet
184
                        width: height
185
                        image: Image {
105.4.2 by Victor Thompson
Merge with trunk and updates to album sheet
186
                            source: Library.hasCover(mainpage.file) ? mainpage.cover : Qt.resolvedUrl("images/cover_default.png")
105.4.1 by Victor Thompson
Initial album sheet
187
                        }
82.1.1 by Victor Thompson
Prevent the ListView from jumping around when current item is being played.
188
                    }
65.2.1 by Victor Thompson
Initial albums tab implementation.
189
                    Label {
159.2.12 by Daniel Holm
Added copy of default cover just to fix the greyish issue when missing; expandable icons in albums and playlist - though not working for some reason.
190
                        id: albumArtist
259 by carla.sella at gmail
Added test_show_albums_sheet.
191
                        objectName: "albumsheet-albumartist"
65.2.1 by Victor Thompson
Initial albums tab implementation.
192
                        wrapMode: Text.NoWrap
65.2.2 by Victor Thompson
Enlarge cover art on Albums tab and add title and artist info.
193
                        maximumLineCount: 1
159.2.12 by Daniel Holm
Added copy of default cover just to fix the greyish issue when missing; expandable icons in albums and playlist - though not working for some reason.
194
                        fontSize: "small"
105.4.1 by Victor Thompson
Initial album sheet
195
                        anchors.left: albumImage.right
196
                        anchors.leftMargin: units.gu(1)
65.2.1 by Victor Thompson
Initial albums tab implementation.
197
                        anchors.top: parent.top
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
198
                        anchors.topMargin: units.gu(1.5)
105.4.1 by Victor Thompson
Initial album sheet
199
                        anchors.right: parent.right
174.3.1 by Andrew Hayzen
* Added elide support to labels in Albums, Artists, Playlists, Tracks and AddToPlaylist
200
                        anchors.rightMargin: units.gu(1.5)
201
                        elide: Text.ElideRight
159.2.12 by Daniel Holm
Added copy of default cover just to fix the greyish issue when missing; expandable icons in albums and playlist - though not working for some reason.
202
                        text: mainpage.artist
203
                    }
204
                    Label {
205
                        id: albumLabel
206
                        wrapMode: Text.NoWrap
207
                        maximumLineCount: 2
208
                        fontSize: "medium"
159.2.18 by Daniel Holm
Fix height issues with expandable items in albums and artists; use darker font color for focus; margin and font size changes all over the place; more.
209
                        color: styleMusic.common.music
159.2.12 by Daniel Holm
Added copy of default cover just to fix the greyish issue when missing; expandable icons in albums and playlist - though not working for some reason.
210
                        anchors.left: albumImage.right
211
                        anchors.leftMargin: units.gu(1)
212
                        anchors.top: albumArtist.bottom
213
                        anchors.topMargin: units.gu(0.8)
214
                        anchors.right: parent.right
174.3.1 by Andrew Hayzen
* Added elide support to labels in Albums, Artists, Playlists, Tracks and AddToPlaylist
215
                        anchors.rightMargin: units.gu(1.5)
216
                        elide: Text.ElideRight
105.4.2 by Victor Thompson
Merge with trunk and updates to album sheet
217
                        text: mainpage.album
105.4.1 by Victor Thompson
Initial album sheet
218
                    }
219
                    Label {
220
                        id: albumYear
221
                        wrapMode: Text.NoWrap
222
                        maximumLineCount: 1
159.2.12 by Daniel Holm
Added copy of default cover just to fix the greyish issue when missing; expandable icons in albums and playlist - though not working for some reason.
223
                        fontSize: "x-small"
224
                        anchors.left: albumImage.right
225
                        anchors.leftMargin: units.gu(1)
226
                        anchors.top: albumLabel.bottom
227
                        anchors.topMargin: units.gu(2)
228
                        anchors.right: parent.right
174.3.1 by Andrew Hayzen
* Added elide support to labels in Albums, Artists, Playlists, Tracks and AddToPlaylist
229
                        anchors.rightMargin: units.gu(1.5)
230
                        elide: Text.ElideRight
127.7.15 by David Planella
Some i18n improvements on plurals
231
                        text: i18n.tr("%1 | %2 song", "%1 | %2 songs", albumTracksModel.model.count).arg(mainpage.year, albumTracksModel.model.count)
159.2.12 by Daniel Holm
Added copy of default cover just to fix the greyish issue when missing; expandable icons in albums and playlist - though not working for some reason.
232
                    }
105.4.1 by Victor Thompson
Initial album sheet
233
                }
234
235
                onCountChanged: {
236
                    albumtrackslist.currentIndex = albumTracksModel.indexOf(currentFile)
237
                }
238
239
                Component {
240
                    id: albumTracksDelegate
241
242
                    ListItem.Standard {
243
                        id: track
244
                        iconFrame: false
245
                        progression: false
159.2.12 by Daniel Holm
Added copy of default cover just to fix the greyish issue when missing; expandable icons in albums and playlist - though not working for some reason.
246
                        height: styleMusic.albums.itemHeight
159.3.1 by Andrew Hayzen
* Fix for expanding on album and artist pages
247
248
                        MouseArea {
249
                            anchors.fill: parent
250
                            onDoubleClicked: {
251
                            }
252
                            onClicked: {
253
                                if (focus == false) {
254
                                    focus = true
255
                                }
256
                                trackClicked(albumTracksModel, index)  // play track
220.1.1 by Victor Thompson
Initial db work for recent items.
257
                                Library.addRecent(album, artist, cover, album, "album")
220.1.2 by Victor Thompson
Intitial Recent list for playlists and albums
258
                                mainView.hasRecent = true
259
                                recentModel.filterRecent()
220.1.1 by Victor Thompson
Initial db work for recent items.
260
159.3.1 by Andrew Hayzen
* Fix for expanding on album and artist pages
261
                                // TODO: This closes the SDK defined sheet
262
                                //       component. It should be able to close
263
                                //       albumSheet.
264
                                PopupUtils.close(sheet)
265
                            }
266
                        }
267
105.4.1 by Victor Thompson
Initial album sheet
268
                        Label {
269
                            id: trackTitle
270
                            wrapMode: Text.NoWrap
271
                            maximumLineCount: 1
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
272
                            fontSize: "medium"
105.4.1 by Victor Thompson
Initial album sheet
273
                            anchors.left: parent.left
274
                            anchors.leftMargin: units.gu(2)
275
                            anchors.top: parent.top
159.2.12 by Daniel Holm
Added copy of default cover just to fix the greyish issue when missing; expandable icons in albums and playlist - though not working for some reason.
276
                            anchors.topMargin: units.gu(1)
277
                            anchors.bottom: parent.bottom
278
                            anchors.bottomMargin: units.gu(1)
174.3.1 by Andrew Hayzen
* Added elide support to labels in Albums, Artists, Playlists, Tracks and AddToPlaylist
279
                            anchors.right: expandItem.left
280
                            anchors.rightMargin: units.gu(1.5)
281
                            elide: Text.ElideRight
105.4.1 by Victor Thompson
Initial album sheet
282
                            text: model.title == "" ? model.file : model.title
283
                        }
284
159.2.7 by Daniel Holm
Save.
285
                        Image {
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
286
                            id: expandItem
287
                            anchors.right: parent.right
288
                            anchors.rightMargin: units.gu(2)
200.1.1 by Victor Thompson
Add item contraction indicator.
289
                            source: expandable.visible ? "images/dropdown-menu-up.svg" : "images/dropdown-menu.svg"
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
290
                            height: styleMusic.common.expandedItem
291
                            width: styleMusic.common.expandedItem
210.2.1 by Andrew Hayzen
* Fix so that the expand buttons are centred
292
                            y: parent.y + (styleMusic.albums.itemHeight / 2) - (height / 2)
159.2.34 by Andrew Hayzen
* Tweaked mouseArea to make it easier on a touch device to click the
293
                        }
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
294
159.2.34 by Andrew Hayzen
* Tweaked mouseArea to make it easier on a touch device to click the
295
                        MouseArea {
296
                            anchors.bottom: parent.bottom
297
                            anchors.right: parent.right
298
                            anchors.top: parent.top
299
                            width: styleMusic.common.expandedItem * 3
300
                            onClicked: {
301
                               if(expandable.visible) {
302
                                   customdebug("clicked collapse")
303
                                   expandable.visible = false
304
                                   track.height = styleMusic.albums.itemHeight
305
                               }
306
                               else {
307
                                   customdebug("clicked expand")
203.1.1 by Andrew Hayzen
* Only allow one expand to be visible at one time
308
                                   collapseExpand(-1);  // collapse all others
159.2.34 by Andrew Hayzen
* Tweaked mouseArea to make it easier on a touch device to click the
309
                                   expandable.visible = true
310
                                   track.height = styleMusic.albums.expandedHeight
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
311
                               }
312
                           }
159.2.34 by Andrew Hayzen
* Tweaked mouseArea to make it easier on a touch device to click the
313
                       }
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
314
315
                        Rectangle {
316
                            id: expandable
206.1.1 by Andrew Hayzen
* Implement transparent background in the expander
317
                            color: "transparent"
318
                            height: styleMusic.albums.expandHeight
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
319
                            visible: false
320
                            MouseArea {
321
                               anchors.fill: parent
322
                               onClicked: {
323
                                   customdebug("User pressed outside the playlist item and expanded items.")
203.1.1 by Andrew Hayzen
* Only allow one expand to be visible at one time
324
                               }
325
                            }
326
327
                            Component.onCompleted: {
328
                                collapseExpand.connect(onCollapseExpand);
329
                            }
330
331
                            function onCollapseExpand(indexCol)
332
                            {
333
                                if ((indexCol === index || indexCol === -1) && expandable !== undefined && expandable.visible === true)
334
                                {
335
                                    customdebug("auto collapse")
336
                                    expandable.visible = false
337
                                    track.height = styleMusic.albums.itemHeight
338
                                }
339
                            }
340
206.1.1 by Andrew Hayzen
* Implement transparent background in the expander
341
                            // background for expander
342
                            Rectangle {
343
                                anchors.top: parent.top
344
                                anchors.topMargin: styleMusic.albums.itemHeight
345
                                color: styleMusic.common.black
346
                                height: styleMusic.albums.expandedHeight - styleMusic.albums.itemHeight
347
                                width: track.width
348
                                opacity: 0.4
349
                            }
350
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
351
                            // add to playlist
159.2.37 by Andrew Hayzen
* Round of bug fixes
352
                            Rectangle {
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
353
                                id: playlistRow
354
                                anchors.top: parent.top
206.1.2 by Andrew Hayzen
* Fix so that labels are in centre
355
                                anchors.topMargin: ((styleMusic.albums.expandedHeight - styleMusic.albums.itemHeight) / 2)
356
                                                   + styleMusic.albums.itemHeight
357
                                                   - (height / 2)
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
358
                                anchors.left: parent.left
159.2.18 by Daniel Holm
Fix height issues with expandable items in albums and artists; use darker font color for focus; margin and font size changes all over the place; more.
359
                                anchors.leftMargin: styleMusic.albums.expandedLeftMargin
159.2.37 by Andrew Hayzen
* Round of bug fixes
360
                                color: "transparent"
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
361
                                height: styleMusic.common.expandedItem
362
                                width: units.gu(15)
159.2.12 by Daniel Holm
Added copy of default cover just to fix the greyish issue when missing; expandable icons in albums and playlist - though not working for some reason.
363
                                Icon {
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
364
                                    id: playlistTrack
206.1.3 by Andrew Hayzen
* Use white as the colour for Icons so they can be seen on the expander
365
                                    color: styleMusic.common.white
159.2.12 by Daniel Holm
Added copy of default cover just to fix the greyish issue when missing; expandable icons in albums and playlist - though not working for some reason.
366
                                    name: "add"
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
367
                                    height: styleMusic.common.expandedItem
368
                                    width: styleMusic.common.expandedItem
369
                                }
370
                                Label {
206.1.1 by Andrew Hayzen
* Implement transparent background in the expander
371
                                    anchors.left: playlistTrack.right
372
                                    anchors.leftMargin: units.gu(0.5)
373
                                    color: styleMusic.common.white
374
                                    fontSize: "small"
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
375
                                    text: i18n.tr("Add to playlist")
376
                                    wrapMode: Text.WordWrap
377
                                }
378
                                MouseArea {
379
                                   anchors.fill: parent
380
                                   onClicked: {
381
                                       expandable.visible = false
159.2.18 by Daniel Holm
Fix height issues with expandable items in albums and artists; use darker font color for focus; margin and font size changes all over the place; more.
382
                                       track.height = styleMusic.albums.itemHeight
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
383
                                       chosenArtist = artist
384
                                       chosenTitle = title
385
                                       chosenTrack = file
386
                                       chosenAlbum = album
387
                                       chosenCover = cover
388
                                       chosenGenre = genre
389
                                       chosenIndex = index
390
                                       console.debug("Debug: Add track to playlist")
391
                                       PopupUtils.open(Qt.resolvedUrl("MusicaddtoPlaylist.qml"), mainView,
392
                                       {
393
                                           title: i18n.tr("Select playlist")
394
                                       } )
395
                                 }
396
                               }
397
                            }
398
                            // Queue
159.2.37 by Andrew Hayzen
* Round of bug fixes
399
                            Rectangle {
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
400
                                id: queueRow
401
                                anchors.top: parent.top
206.1.2 by Andrew Hayzen
* Fix so that labels are in centre
402
                                anchors.topMargin: ((styleMusic.albums.expandedHeight - styleMusic.albums.itemHeight) / 2)
403
                                                   + styleMusic.albums.itemHeight
404
                                                   - (height / 2)
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
405
                                anchors.left: playlistRow.left
406
                                anchors.leftMargin: units.gu(15)
159.2.37 by Andrew Hayzen
* Round of bug fixes
407
                                color: "transparent"
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
408
                                height: styleMusic.common.expandedItem
409
                                width: units.gu(15)
410
                                Image {
411
                                    id: queueTrack
412
                                    source: "images/queue.png"
413
                                    height: styleMusic.common.expandedItem
414
                                    width: styleMusic.common.expandedItem
415
                                }
416
                                Label {
206.1.1 by Andrew Hayzen
* Implement transparent background in the expander
417
                                    anchors.left: queueTrack.right
418
                                    anchors.leftMargin: units.gu(0.5)
419
                                    color: styleMusic.common.white
420
                                    fontSize: "small"
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
421
                                    text: i18n.tr("Queue")
422
                                    wrapMode: Text.WordWrap
423
                                }
424
                                MouseArea {
425
                                   anchors.fill: parent
426
                                   onClicked: {
427
                                       expandable.visible = false
159.2.18 by Daniel Holm
Fix height issues with expandable items in albums and artists; use darker font color for focus; margin and font size changes all over the place; more.
428
                                       track.height = styleMusic.albums.itemHeight
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
429
                                       console.debug("Debug: Add track to queue: " + title)
159.2.31 by Andrew Hayzen
* Fix for queuing items from the expandable item
430
                                       trackQueue.model.append({"title": title, "artist": artist, "file": file, "album": album, "cover": cover, "genre": genre})
159.2.6 by Daniel Holm
Replaced some of our own icons with using system's.
431
                                 }
432
                               }
433
                            }
434
                        }
435
105.4.1 by Victor Thompson
Initial album sheet
436
                        onFocusChanged: {
437
                        }
438
                        Component.onCompleted: {
439
                        }
82.1.1 by Victor Thompson
Prevent the ListView from jumping around when current item is being played.
440
                    }
65.2.1 by Victor Thompson
Initial albums tab implementation.
441
                }
442
            }
29.2.1 by Daniel Holm
Beginning of Lucas' design ideas (0.04); back to tabs and start of scobble
443
        }
444
    }
445
}
105.4.1 by Victor Thompson
Initial album sheet
446
447