Fix window stacking on Maemo 5
[pywienerlinien] / ui / OverviewItem.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: '#267'
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: datum
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 * .2
36         color: row.textColor
37     }
38
39     Text {
40         id: time_from
41         color: row.textColor
42         anchors.left: datum.right
43         anchors.bottom: parent.verticalCenter
44         text: 'von ' + modelData.time_from
45         verticalAlignment: Text.AlignBottom
46         width: parent.width * .2
47         visible: modelData.time_from != '-'
48     }
49
50     Text {
51         id: time_to
52         color: row.textColor
53         anchors.left: datum.right
54         anchors.top: parent.verticalCenter
55         text: 'bis ' + modelData.time_to
56         anchors.rightMargin: 40
57         verticalAlignment: Text.AlignTop
58         width: time_from.width
59         visible: modelData.time_to != '-'
60     }
61
62     Text {
63         id: dauer
64         color: row.textColor
65         text: 'Dauer: ' + modelData.duration + ((modelData.change > 0)?(' (' + modelData.change + ' x umsteigen)'):'')
66         font.pixelSize: 17
67         anchors.left: time_from.right
68         anchors.top: parent.top
69         anchors.bottom: parent.bottom
70         verticalAlignment: Text.AlignVCenter
71         width: parent.width * .3
72     }
73
74     Text {
75         id: price
76         color: row.textColor
77         text: 'EUR ' + modelData.price
78         anchors.right: parent.right
79         anchors.top: parent.top
80         anchors.bottom: parent.bottom
81         verticalAlignment: Text.AlignVCenter
82         width: parent.width * .1
83         horizontalAlignment: Text.AlignRight
84         anchors.rightMargin: 20
85     }
86
87     MouseArea {
88         id: mouse
89         anchors.fill: parent
90         onClicked: parent.showDetails(modelData)
91     }
92 }