innitial commit
[xbmc-qml-remote:xbmc-qml-remote.git] / FRow.qml
1 import Qt 4.7
2 import "script.js" as Script
3
4
5 Rectangle {
6         property alias text: rowText.text
7         property bool selected: false;
8         width: 800;
9         height: 80
10         id: content
11         gradient: selected ? highlight : normal
12         Gradient {
13                 id: normal
14                 GradientStop { position: 0.0; color: "#333" }
15                 GradientStop { position: 1.0; color: "#000" }
16         }
17         Gradient {
18                 id: pressed
19                 GradientStop { position: 0.0; color: "#336" }
20                 GradientStop { position: 1.0; color: "#003" }
21         }
22         Gradient {
23                 id: highlight
24                 GradientStop { position: 0.0; color: "#669" }
25                 GradientStop { position: 1.0; color: "#336" }
26         }
27         Item {
28                 x: 0
29                 y: 0
30                 width: 800
31                 height: 80
32                 Text {
33                         id: rowText
34                         y: 20
35                         x: 10
36                         color: "#ffffff"
37                         wrapMode: Text.Wrap
38                         font.pointSize: 25
39
40                 }
41                 MouseArea {
42                         id: mouseArea
43                         anchors.fill: parent;
44                         onClicked: {
45                                 timer.start()
46                                 content.state = "pressed"
47                                 content.clicked(id);
48                         }
49                 }
50         }
51         states: [
52                 State {
53                         name: "normal"
54                         PropertyChanges {
55                                 target: content
56                                 gradient: normal
57                         }
58                 },
59                 State {
60                         name: "highlight"
61                         PropertyChanges {
62                                 target: content
63                                 gradient: highlight
64                         }
65                 },
66                 State {
67                         name: "pressed"
68                         PropertyChanges {
69                                 target: content
70                                 gradient: pressed
71                         }
72                 }
73
74         ]
75         Timer {
76                 id: timer
77                 interval: 500; running: false; repeat: false
78                 onTriggered: content.state = selected ? "highlight" : "normal"
79
80         }
81 }
82