Show/hide UI elements for setting resolution and aspect ratio
[harmattan/cameraplus] / qml / CameraSettings.qml
1 // -*- qml -*-
2
3 /*!
4  * This file is part of CameraPlus.
5  *
6  * Copyright (C) 2012-2013 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 2.0
24
25 Column {
26     id: col
27     spacing: 10
28     width: parent.width
29
30     CameraLabel {
31         font.pixelSize: 36
32         text: qsTr("Camera settings")
33         width: parent.width
34     }
35
36     SectionHeader {
37         text: qsTr("Camera")
38         width: parent.width
39     }
40
41     CameraButtonRow {
42         anchors.horizontalCenter: parent.horizontalCenter
43
44         CameraButton {
45             text: qsTr("Back (Primary)");
46             checkable: true
47             checked: settings.device == 0
48             onClicked: settings.device = 0
49         }
50
51         CameraButton {
52             text: qsTr("Front (Secondary)");
53             checkable: true
54             checked: settings.device == 1
55             onClicked: settings.device = 1
56         }
57     }
58
59     TextSwitch {
60         text: qsTr("Show grid lines")
61
62         // We have to do it that way because QML complains about a binding
63         // loop for checked if we bind the checked property to the settings value.
64         Component.onCompleted: checked = settings.gridEnabled
65
66         onCheckedChanged: settings.gridEnabled = checked
67     }
68
69     SectionHeader {
70         text: qsTr("Creator name")
71         width: parent.width
72     }
73
74     CameraTextField {
75         placeholderText: qsTr("Name or copyright")
76         width: parent.width
77         text: settings.creatorName
78         onTextChanged: settings.creatorName = text
79     }
80
81     TextSwitch {
82         text: qsTr("Use zoom keys for capture")
83
84         // We have to do it that way because QML complains about a binding
85         // loop for checked if we bind the checked property to the settings value.
86         Component.onCompleted: checked = settings.zoomAsShutter
87         onCheckedChanged: settings.zoomAsShutter = checked
88     }
89
90     TextSwitch {
91         text: qsTr("Enable camera sounds")
92
93         // We have to do it that way because QML complains about a binding
94         // loop for checked if we bind the checked property to the settings value.
95         Component.onCompleted: checked = settings.soundEnabled
96         onCheckedChanged: settings.soundEnabled = checked
97     }
98
99     TextSwitch {
100         id: useGps
101         text: qsTr("Use GPS")
102
103         // We have to do it that way because QML complains about a binding
104         // loop for checked if we bind the checked property to the settings value.
105         Component.onCompleted: checked = settings.useGps
106         onCheckedChanged: settings.useGps = checked
107     }
108
109     TextSwitch {
110         // TODO: transition when hiding/showing and we should scroll a bit to show it
111         visible: useGps.checked
112
113         text: qsTr("Use geotags")
114
115         // We have to do it that way because QML complains about a binding
116         // loop for checked if we bind the checked property to the settings value.
117         Component.onCompleted: checked = settings.useGeotags
118         onCheckedChanged: settings.useGeotags = checked
119     }
120 }