Added gallery integration
[harmattan/cameraplus] / qml / ListItem.qml
1 // -*- qml -*-
2
3 /*!
4  * This file is part of CameraPlus.
5  *
6  * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21  */
22
23 import QtQuick 1.1
24 import com.nokia.meego 1.1
25
26 // This mimics MListItem
27
28 Rectangle {
29         signal clicked
30
31         property alias title: title.text
32         property alias subtitle: subtitle.text
33
34         property string iconId: ""
35
36         height: 100
37
38         id: button
39         color: mouse.pressed ? "#464646" : "black"
40
41         MouseArea {
42                 id: mouse
43                 anchors.fill: parent
44                 onClicked: button.clicked();
45         }
46
47         Image {
48                 id: icon
49                 anchors.top: button.top
50                 anchors.bottom: button.bottom
51                 anchors.left: button.left
52                 width: height
53                 height: button.height
54                 anchors.margins: 10
55                 source: button.iconId != "" ? "image://theme/" + button.iconId : ""
56         }
57
58         Label {
59                 id: title
60                 anchors.top: button.top
61                 anchors.left: icon.right
62                 anchors.right: button.right
63                 anchors.margins: 10
64                 font.bold: true
65         }
66
67         Label {
68                 id: subtitle
69                 anchors.top: title.bottom
70                 anchors.bottom: button.bottom
71                 anchors.left: icon.right
72                 anchors.right: button.right
73                 anchors.margins: 10
74                 platformStyle: LabelStyle {
75                         textColor: "lightgray"
76                 }
77         }
78 }