Adjust the font size for the headers in the settings pages
[harmattan/cameraplus] / qml / CameraSettings.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 Column {
27         id: col
28         spacing: 10
29
30         Label {
31                 font.pixelSize: 36
32                 text: qsTr("Camera settings");
33         }
34
35         SectionHeader {
36                 text: qsTr("Show captured content");
37         }
38
39         ButtonRow {
40                 anchors.horizontalCenter: parent.horizontalCenter
41
42                 Button {
43                         text: qsTr("Disabled");
44                         checked: settings.postCaptureTimeout == 0;
45                         onClicked: settings.postCaptureTimeout = 0;
46                 }
47
48                 Button {
49                         text: qsTr("2 seconds");
50                         checked: settings.postCaptureTimeout == 2;
51                         onClicked: settings.postCaptureTimeout = 2;
52                 }
53
54                 Button {
55                         text: qsTr("5 seconds");
56                         checked: settings.postCaptureTimeout == 10;
57                         onClicked: settings.postCaptureTimeout = 10;
58                 }
59
60                 Button {
61                         text: qsTr("No timeout");
62                         checked: settings.postCaptureTimeout == -1;
63                         onClicked: settings.postCaptureTimeout = -1;
64                 }
65         }
66
67         SectionHeader {
68                 text: qsTr("Creator name");
69         }
70
71         TextField {
72                 placeholderText: qsTr("Name or copyright");
73                 width: parent.width
74                 text: settings.creatorName
75                 onTextChanged: settings.creatorName = text;
76         }
77
78         Item {
79                 width: parent.width
80                 height: Math.max(enableCameraSoundsLabel.height, enableCameraSounds.height);
81
82                 Label {
83                         id: enableCameraSoundsLabel
84                         anchors.left: parent.left
85                         text: qsTr("Enable camera sounds");
86                 }
87
88                 Switch {
89                         id: enableCameraSounds
90                         anchors.right: parent.right
91                         // We have to do it that way because QML complains about a binding
92                         // loop for checked if we bind the checked property to the settings value.
93                         Component.onCompleted: checked = settings.soundEnabled;
94                         onCheckedChanged: settings.soundEnabled = checked;
95                 }
96         }
97
98         Item {
99                 width: parent.width
100                 height: Math.max(useGpsLabel.height, useGps.height);
101
102                 Label {
103                         id: useGpsLabel
104                         anchors.left: parent.left
105                         text: qsTr("Use GPS");
106                 }
107
108                 Switch {
109                         id: useGps
110                         anchors.right: parent.right
111                         // We have to do it that way because QML complains about a binding
112                         // loop for checked if we bind the checked property to the settings value.
113                         Component.onCompleted: checked = settings.useGps;
114                         onCheckedChanged: settings.useGps = checked;
115                 }
116         }
117
118         Item {
119                 width: parent.width
120                 height: Math.max(useGeotagsLabel.height, useGeotags.height);
121
122                 // TODO: transition when hiding/showing and we should scroll a bit to show it
123                 visible: useGps.checked
124
125                 Label {
126                         id: useGeotagsLabel
127                         anchors.left: parent.left
128                         text: qsTr("Use geotags");
129                 }
130
131                 Switch {
132                         id: useGeotags
133                         anchors.right: parent.right
134                         // We have to do it that way because QML complains about a binding
135                         // loop for checked if we bind the checked property to the settings value.
136                         Component.onCompleted: checked = settings.useGeotags;
137                         onCheckedChanged: settings.useGeotags = checked;
138                 }
139         }
140 }