More logic to edit the song metadata
[mussorgsky] / ui / SongsPage.qml
1 import QtQuick 1.1
2 import com.meego 1.0
3 import "UIConstants.js" as UiConstants
4 import "UIConstantsExtras.js" as UiConstantsExtras
5
6 Page {
7     id: songsPage
8     anchors.fill: parent
9
10     ListView {
11         id: listView
12         anchors.fill: parent
13         anchors.leftMargin: 6
14         anchors.rightMargin: 6
15         model: songModel
16         //pressDelay: 140
17
18         delegate:  Item {
19             id: listItem
20             height: 88
21             width: parent.width
22
23             BorderImage {
24                 id: background
25                 anchors.fill: parent
26                 // Fill page porders
27                 //anchors.leftMargin: listItem.leftMargin
28                 //anchors.rightMargin: listItem.rightMargin
29                 visible: mouseArea.pressed
30                 source: "image://theme/meegotouch-list-background-pressed-center"
31             }
32
33             Row {
34                 anchors.fill: parent
35
36                 Column {
37                     anchors.verticalCenter: parent.verticalCenter
38
39                     Label {
40                         id: mainText
41                         text: model.song.title
42                         font.family: UiConstantsExtras.TITLE_FONT_FAMILY
43                         font.pixelSize: UiConstantsExtras.TITLE_FONT_PIXEL_SIZE
44                         font.bold: UiConstantsExtras.TITLE_FONT_BOLD
45                     }
46
47                     Label {
48                         id: subText
49                         text: model.song.artist + " / " + model.song.album
50                         font.family: UiConstantsExtras.SUBTITLE_FONT_FAMILY
51                         font.pixelSize: UiConstantsExtras.SUBTITLE_FONT_PIXEL_SIZE
52                         font.bold: UiConstantsExtras.SUBTITLE_FONT_BOLD
53                         color: "#cc6633"
54
55                         visible: text != ""
56                     }
57                 }
58             }
59
60             Image {
61                 source: "image://theme/icon-m-common-drilldown-arrow" + (theme.inverted ? "-inverse" : "")
62                 anchors.right: parent.right;
63                 anchors.verticalCenter: parent.verticalCenter
64             }
65
66             MouseArea {
67                 id: mouseArea
68                 anchors.fill: listItem
69                 onClicked: {
70                     console.log ("Well, well, well")
71                     editionSheet.song = model.song
72                     editionSheet.open ()
73                 }
74             }
75         }
76     }
77
78     SongEditor { id: editionSheet ; visualParent: songsPage }
79
80 }