innitial commit
[xbmc-qml-remote:xbmc-qml-remote.git] / Artist.qml
1 import Qt 4.7
2 import "script.js" as Script
3
4 Item {
5         width: 800
6         height: parent.height -80
7         id: artistComponent
8         x: 0
9         y: 80
10         //signal clicked
11
12         ListView {
13                 id: artistView
14
15                 width: parent.width
16                 height: parent.height
17                 model: artistModel
18                 delegate: artistDelegate
19         }
20
21
22         Component {
23                 id: artistDelegate
24
25                 FRow {
26                         id: content
27                         text: name
28                         selected: selected
29                         function clicked(id) {
30                                 console.log("track clicked" + id);
31                                 artistComponent.clicked(id);
32                         }
33                 }
34
35                 /*Rectangle {
36                         width: 800;
37                         height: 80
38                         id: content
39
40                         gradient: normal
41                         Gradient {
42                                 id: normal
43                                 GradientStop { position: 0.0; color: "#333" }
44                                 GradientStop { position: 1.0; color: "#000" }
45                         }
46                         Gradient {
47                                 id: pressed
48                                 GradientStop { position: 0.0; color: "#336" }
49                                 GradientStop { position: 1.0; color: "#003" }
50                         }
51                         Item {
52                                 x: 0
53                                 y: 0
54                                 width: 800
55                                 height: 80
56                                 Text {
57                                         y: 20
58                                         x: 10
59                                         text: name
60                                         color: "#ffffff"
61                                         wrapMode: Text.Wrap
62                                         font.pointSize: 25
63
64                                 }
65                                 MouseArea {
66                                         anchors.fill: parent;
67                                         onClicked: {
68                                                 timer.start()
69                                                 content.state = "pressed"
70                                                 artistComponent.clicked(idartist);
71                                                 //Script.loadAlbums(idartist, albumModel);
72
73                                         }
74                                 }
75                         }
76                         states: [
77                                 State {
78                                         name: "normal"
79                                         PropertyChanges {
80                                                 target: content
81                                                 gradient: normal
82                                         }
83                                 },
84                                 State {
85                                         name: "pressed"
86                                         PropertyChanges {
87                                                 target: content
88                                                 gradient: pressed
89                                         }
90                                 }
91
92                         ]
93                         Timer {
94                                 id: timer
95                                 interval: 500; running: false; repeat: false
96                                 onTriggered: content.state = "normal"
97
98                         }
99                 }*/
100
101         }
102
103
104         ListModel {
105                 id: artistModel
106
107         }
108
109
110         function setup() {
111                 var artists = Script.setup(artistModel);
112                 console.log("done");
113                 return;
114         }
115 }