Reworked ModeButton to use a Switch
[harmattan/cameraplus] / qml / ImageWhiteBalancePage.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 import QtCamera 1.0
26 import CameraPlus 1.0
27 import "data.js" as Data
28
29 CameraPage {
30         id: page
31
32         controlsVisible: false
33         policyMode: CameraResources.Image
34         needsPipeline: true
35
36         Rectangle {
37                 color: "black"
38                 width: parent.width
39                 height: row.height + title.height + 30
40                 anchors.bottom: toolBar.top
41                 opacity: 0.5
42
43                 SectionHeader {
44                         id: title
45                         anchors.top: parent.top
46                         anchors.topMargin: 10
47                         text: qsTr("White balance");
48                 }
49
50                 Row {
51                         id: row
52                         anchors.left: parent.left
53                         anchors.right: parent.right
54                         anchors.leftMargin: 20
55                         anchors.rightMargin: 20
56                         anchors.top: title.bottom
57                         anchors.topMargin: 10
58
59                         IconButton {
60                                 width: parent.width / 5
61                                 normalIcon: "image://theme/" + Data.wbIcon(value);
62                                 checkedIcon: "image://theme/" + Data.wbSelectedIcon(value);
63                                 value: WhiteBalance.Auto
64                                 savedValue: settings.imageWhiteBalance
65                                 onClicked: settings.imageWhiteBalance = value;
66                                 text: Data.wbName(value);
67                         }
68
69                         IconButton {
70                                 width: parent.width / 5
71                                 normalIcon: "image://theme/" + Data.wbIcon(value);
72                                 checkedIcon: "image://theme/" + Data.wbSelectedIcon(value);
73                                 value: WhiteBalance.Sunset
74                                 savedValue: settings.imageWhiteBalance
75                                 onClicked: settings.imageWhiteBalance = value;
76                                 text: Data.wbName(value);
77                         }
78
79                         IconButton {
80                                 width: parent.width / 5
81                                 normalIcon: "image://theme/" + Data.wbIcon(value);
82                                 checkedIcon: "image://theme/" + Data.wbSelectedIcon(value);
83                                 value: WhiteBalance.Cloudy
84                                 savedValue: settings.imageWhiteBalance
85                                 onClicked: settings.imageWhiteBalance = value;
86                                 text: Data.wbName(value);
87                         }
88
89                         IconButton {
90                                 width: parent.width / 5
91                                 normalIcon: "image://theme/" + Data.wbIcon(value);
92                                 checkedIcon: "image://theme/" + Data.wbSelectedIcon(value);
93                                 value: WhiteBalance.Flourescent
94                                 savedValue: settings.imageWhiteBalance
95                                 onClicked: settings.imageWhiteBalance = value;
96                                 text: Data.wbName(value);
97                         }
98
99                         IconButton {
100                                 width: parent.width / 5
101                                 normalIcon: "image://theme/" + Data.wbIcon(value);
102                                 checkedIcon: "image://theme/" + Data.wbSelectedIcon(value);
103                                 value: WhiteBalance.Tungsten
104                                 savedValue: settings.imageWhiteBalance
105                                 onClicked: settings.imageWhiteBalance = value;
106                                 text: Data.wbName(value);
107                         }
108                 }
109         }
110
111         ToolBar {
112                 id: toolBar
113                 anchors.bottom: parent.bottom
114                 tools: ToolBarLayout {
115                         id: layout
116                         ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); }
117                 }
118         }
119 }