just testing qml possibilities
[pywienerlinien] / gotovienna / gotovienna_qml / qml / gotovienna_qml / ListItem.qml
1 import Qt 4.7
2
3 Rectangle {
4     id: row
5     property color textColor: 'white'
6
7     anchors.left: parent.left
8     anchors.right: parent.right
9     height: 70
10
11     //Image {
12     //    source: 'bg.png'
13     //    anchors.fill: parent
14     //}
15
16     Rectangle {
17         color: '#467'
18         opacity: mouse.pressed?.4:0
19         anchors.fill: parent
20         Behavior on opacity { PropertyAnimation { duration: 200 } }
21     }
22
23     signal showDetails(variant details)
24
25     Text {
26         id: line
27         anchors.left: parent.left
28         anchors.top: parent.top
29         anchors.bottom: parent.bottom
30         verticalAlignment: Text.AlignVCenter
31         text: modelData.date
32         font.pixelSize: 20
33         anchors.leftMargin: 30
34         anchors.rightMargin: 30
35         width: parent.width * .20
36         color: row.textColor
37     }
38
39     Text {
40         id: direction
41         color: row.textColor
42         anchors.left: line.right
43         anchors.bottom: parent.verticalCenter
44         text: 'dir'
45         verticalAlignment: Text.AlignBottom
46         width: parent.width * .40
47     }
48
49     Image {
50         id: accessibility
51         source: '../../wheelchair.png'
52         height: 50
53         width: 50
54         anchors.left: direction.right
55         anchors.bottom: parent.verticalCenter
56     }
57
58     Text {
59         id: time
60         color: row.textColor
61         anchors.left: accessibility.right
62         anchors.bottom: parent.verticalCenter
63         text: '10 min'
64         verticalAlignment: Text.AlignBottom
65         width: parent.width * .20
66     }
67
68     MouseArea {
69         id: mouse
70         anchors.fill: parent
71         onClicked: parent.showDetails(modelData)
72     }
73 }
74