Kill com.nokia.meego importing in the ui.
[harmattan/cameraplus] / qml / ImageResolutionSettings.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_QT_QUICK@
24
25 Column {
26     spacing: 10
27
28     SectionHeader {
29         text: qsTr("Aspect ratio")
30     }
31
32     CameraButtonRow {
33         id: aspectRatioRow
34         width: parent.width
35         enabled: cam.idle
36         exclusive: false
37
38         Repeater {
39             model: imageSettings.aspectRatios
40             delegate: CameraButton {
41                 text: qsTr(modelData)
42                 checked: settings.imageAspectRatio == modelData
43                 onClicked: settings.imageAspectRatio = modelData
44             }
45         }
46     }
47
48     SectionHeader {
49         text: qsTr("Resolution")
50     }
51
52     CameraButtonRow {
53         id: resolutionsRow
54         width: parent.width
55         enabled: cam.idle
56         exclusive: false
57
58         Binding {
59             target: imageSettings.resolutions
60             property: "aspectRatio"
61             value: settings.imageAspectRatio
62         }
63
64         Repeater {
65             id: resolutions
66             model: imageSettings.resolutions.aspectRatio == settings.imageAspectRatio ?
67                 imageSettings.resolutions : undefined
68
69             delegate: CameraButton {
70                 font.capitalization: Font.Capitalize
71                 text: qsTr("%1 %2 Mpx").arg(resolutionName).arg(megaPixels)
72                 checked: settings.imageResolution == resolutionName
73                 onClicked: settings.imageResolution = resolutionName
74             }
75         }
76     }
77 }