aae9fa4fa77b4344b195f2e38a22c127a39d0af2
[mussorgsky] / ui / AlbumList.qml
1 import Qt 4.7
2
3 ListView {
4     id: albumListView
5     anchors.fill: parent
6
7     delegate: Component {
8           Rectangle {
9               width: albumListView.width
10               height: 60
11               color: ((index % 2 == 0) ? "#222":"#111")
12               
13               Image {
14                  id: cover
15                  source: model.album.album_art || "images/button-blue.png"
16                  width: 50
17                  height: 50
18                  anchors.left: parent.left
19                  anchors.top: parent.top
20                  anchors.leftMargin: (parent.height - width)/2
21                  anchors.topMargin: (parent.height - height)/2
22               }              
23
24
25               Text {
26                  id:title
27                  text:model.album.title
28                  color: "white"
29                  font.bold: true
30                  anchors.top: parent.top
31                  anchors.left: cover.right
32                  anchors.right: parent.right
33                  anchors.bottom: parent.verticalCenter
34                  verticalAlignment: Text.AlignBottom
35                  anchors.leftMargin: 10
36               }
37
38               Text {
39                  id:artist
40                  text:model.album.artist
41                  color: "#aaa"
42                  anchors.top: title.bottom
43                  anchors.left: cover.right
44                  anchors.right: parent.right
45                  anchors.bottom: parent.bottom
46                  verticalAlignment: Text.AlignTop
47                  anchors.leftMargin: 10
48               }
49           }
50     }
51
52 }