~vthompson/music-app/lookup-file

« back to all changes in this revision

Viewing changes to MusicPlaylists.qml

* Abstract listitem common structure into MusicRow.qml
* Add support for new row in SongsSheet.qml, MusicArtists.qml, MusicPlaylists.qml, MusicSearch.qml and MusicaddtoPlaylist.qml.

Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
                property string name: model.name
153
153
                property string count: model.count
154
154
                property var covers: Playlists.getPlaylistCovers(name)
 
155
                height: styleMusic.common.itemHeight
155
156
                iconFrame: false
156
 
                height: styleMusic.playlist.playlistItemHeight
157
 
 
158
 
                Rectangle {
159
 
                    id: trackContainer;
160
 
                    anchors {
161
 
                        fill: parent
162
 
                        margins: units.gu(0.5)
163
 
                        rightMargin: expandable.expanderButtonWidth
164
 
                    }
165
 
                    color: "transparent"
166
 
 
167
 
                    CoverRow {
168
 
                        id: coverRow
169
 
                        anchors {
170
 
                            top: parent.top
171
 
                            left: parent.left
172
 
                            margins: units.gu(1)
173
 
                        }
174
 
                        count: playlist.covers.length
175
 
                        size: styleMusic.playlist.playlistAlbumSize
176
 
                        covers: playlist.covers
177
 
                    }
178
 
 
179
 
                    // songs count
180
 
                    Label {
181
 
                        id: playlistCount
182
 
                        anchors {
183
 
                            top: parent.top
184
 
                            left: parent.left
185
 
                            right: parent.right
186
 
                            topMargin: units.gu(2)
187
 
                            leftMargin: units.gu(12)
188
 
                            rightMargin: units.gu(1.5)
189
 
                        }
190
 
                        elide: Text.ElideRight
191
 
                        fontSize: "x-small"
192
 
                        color: styleMusic.common.subtitle
193
 
                        height: units.gu(1)
194
 
                        text: i18n.tr("%1 song", "%1 songs", playlist.count).arg(playlist.count)
195
 
                    }
196
 
                    // playlist name
197
 
                    Label {
198
 
                        id: playlistName
199
 
                        anchors {
200
 
                            top: playlistCount.bottom
201
 
                            left: playlistCount.left
202
 
                            right: parent.right
203
 
                            topMargin: units.gu(1)
204
 
                            rightMargin: units.gu(1.5)
205
 
                        }
206
 
                        wrapMode: Text.NoWrap
207
 
                        maximumLineCount: 1
208
 
                        fontSize: "medium"
209
 
                        color: styleMusic.common.music
210
 
                        elide: Text.ElideRight
211
 
                        text: playlist.name
 
157
 
 
158
                MusicRow {
 
159
                    covers: playlist.covers
 
160
                    column: Column {
 
161
                        spacing: units.gu(1)
 
162
                        Label {
 
163
                            id: playlistCount
 
164
                            color: styleMusic.common.subtitle
 
165
                            elide: Text.ElideRight
 
166
                            fontSize: "x-small"
 
167
                            height: units.gu(2)
 
168
                            maximumLineCount: 1
 
169
                            text: i18n.tr("%1 song", "%1 songs", playlist.count).arg(playlist.count)
 
170
                            wrapMode: Text.NoWrap
 
171
                            verticalAlignment: Text.AlignVCenter
 
172
                        }
 
173
                        Label {
 
174
                            id: playlistName
 
175
                            color: styleMusic.common.music
 
176
                            elide: Text.ElideRight
 
177
                            fontSize: "medium"
 
178
                            height: units.gu(2)
 
179
                            maximumLineCount: 1
 
180
                            text: playlist.name
 
181
                            wrapMode: Text.NoWrap
 
182
                            verticalAlignment: Text.AlignVCenter
 
183
                        }
212
184
                    }
213
185
                }
214
186