* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-@IMPORT_QT_QUICK@
-import com.nokia.meego 1.1
+import QtQuick 2.0
+import QtCamera 1.0
Column {
+ property Camera camera: null
+
spacing: 10
+ property string __aspectRatio: settings.device == 1 ?
+ settings.secondaryImageAspectRatio : settings.primaryImageAspectRatio
+ property string __resolution: settings.device == 1 ?
+ settings.secondaryImageResolution : settings.primaryImageResolution
+
SectionHeader {
text: qsTr("Aspect ratio")
+ visible: aspectRatioRow.visible
}
- ButtonRow {
+ CameraButtonRow {
id: aspectRatioRow
width: parent.width
- enabled: cam.idle
+ enabled: camera ? camera.idle : false
exclusive: false
+ visible: imageSettings.aspectRatioCount > 1
Repeater {
model: imageSettings.aspectRatios
- delegate: Button {
+ delegate: CameraButton {
text: qsTr(modelData)
- checked: settings.imageAspectRatio == modelData
- onClicked: settings.imageAspectRatio = modelData
+ checked: __aspectRatio == modelData
+ onClicked: {
+ if (settings.device == 1) {
+ settings.secondaryImageAspectRatio = modelData
+ } else {
+ settings.primaryImageAspectRatio = modelData
+ }
+ }
}
}
}
SectionHeader {
text: qsTr("Resolution")
+ visible: resolutionsRow.visible
}
- ButtonRow {
+ CameraButtonRow {
id: resolutionsRow
width: parent.width
- enabled: cam.idle
+ enabled: camera ? camera.idle : false
exclusive: false
+ visible: imageSettings.resolutions.count > 1
+
+ Binding {
+ target: imageSettings.resolutions
+ property: "aspectRatio"
+ value: settings.primaryImageAspectRatio
+ when: settings.device == 0
+ }
Binding {
target: imageSettings.resolutions
property: "aspectRatio"
- value: settings.imageAspectRatio
+ value: settings.secondaryImageAspectRatio
+ when: settings.device == 1
}
Repeater {
id: resolutions
- model: imageSettings.resolutions.aspectRatio == settings.imageAspectRatio ?
+
+ model: imageSettings.resolutions.aspectRatio == __aspectRatio ?
imageSettings.resolutions : undefined
- delegate: Button {
- font.capitalization: Font.Capitalize
+ delegate: CameraButton {
+ capitalize: true
text: qsTr("%1 %2 Mpx").arg(resolutionName).arg(megaPixels)
- checked: settings.imageResolution == resolutionName
- onClicked: settings.imageResolution = resolutionName
+ checked: __resolution == resolutionName
+ onClicked: {
+ if (settings.device == 1) {
+ settings.secondaryImageResolution = resolutionName
+ } else {
+ settings.primaryImageResolution = resolutionName
+ }
+ }
}
}
}