Added a new property (nightMode) to QtCamMode to use the night framerate
[harmattan/cameraplus] / qml / IconButton.qml
1 // -*- qml -*-
2 import QtQuick 1.1
3 import com.nokia.meego 1.1
4
5 Item {
6         id: root
7         width: Math.max(150, Math.max(label.width, icon.width) + 20);
8         height: 120
9
10         property string normalIcon: ""
11         property string checkedIcon: ""
12         property int value: -1
13         property int savedValue: -1
14
15         property alias iconSource: icon.source
16         property alias text: label.text
17
18         signal clicked
19
20         MouseArea {
21                 anchors.fill: parent
22                 onClicked: root.clicked();
23         }
24
25         Image {
26                 id: icon
27
28                 anchors.top: parent.top
29                 anchors.left: parent.left
30                 anchors.right: parent.right
31                 anchors.topMargin: 10
32                 anchors.leftMargin: 10
33                 anchors.rightMargin: 10
34                 source: root.value == root.savedValue ? checkedIcon : normalIcon
35                 fillMode: Image.PreserveAspectFit
36         }
37
38         Label {
39                 id: label
40                 anchors.left: parent.left
41                 anchors.right: parent.right
42                 anchors.bottom: parent.bottom
43                 anchors.top: icon.bottom
44                 anchors.bottomMargin: 10
45                 anchors.leftMargin: 10
46                 anchors.rightMargin: 10
47                 anchors.topMargin: 10
48                 horizontalAlignment: Text.AlignHCenter
49                 wrapMode: Text.NoWrap
50                 font.pixelSize: 22
51         }
52 }