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