20dee24c65805e712dbaa75bce1a3fecfdf0e46c
[harmattan/cameraplus] / qml / ListItem.qml
1 // -*- qml -*-
2 import QtQuick 1.1
3 import com.nokia.meego 1.1
4
5 // This mimics MListItem
6
7 Rectangle {
8         signal clicked
9
10         property alias title: title.text
11         property alias subtitle: subtitle.text
12
13         property string iconId: ""
14
15         height: 100
16
17         id: button
18         color: mouse.pressed ? "#464646" : "black"
19
20         MouseArea {
21                 id: mouse
22                 anchors.fill: parent
23                 onClicked: button.clicked();
24         }
25
26         Image {
27                 id: icon
28                 anchors.top: button.top
29                 anchors.bottom: button.bottom
30                 anchors.left: button.left
31                 width: height
32                 height: button.height
33                 anchors.margins: 10
34                 source: button.iconId != "" ? "image://theme/" + button.iconId : ""
35         }
36
37         Label {
38                 id: title
39                 anchors.top: button.top
40                 anchors.left: icon.right
41                 anchors.right: button.right
42                 anchors.margins: 10
43                 font.bold: true
44         }
45
46         Label {
47                 id: subtitle
48                 anchors.top: title.bottom
49                 anchors.bottom: button.bottom
50                 anchors.left: icon.right
51                 anchors.right: button.right
52                 anchors.margins: 10
53                 platformStyle: LabelStyle {
54                         textColor: "lightgray"
55                 }
56         }
57 }