X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=qml%2FImageResolutionSettings.qml;h=e287394fa6a174b1ac88bdbaafb0f57ffbd3a965;hb=38ae6c17352880f8603d806addba1dfa30b0f5a7;hp=8d6df88701fb0596b3f7f0fcd3f96592325ec733;hpb=f8ed08bce9bc9f9a472993aec1c7b5c75de40836;p=harmattan%2Fcameraplus diff --git a/qml/ImageResolutionSettings.qml b/qml/ImageResolutionSettings.qml index 8d6df88..e287394 100644 --- a/qml/ImageResolutionSettings.qml +++ b/qml/ImageResolutionSettings.qml @@ -3,7 +3,7 @@ /*! * This file is part of CameraPlus. * - * Copyright (C) 2012 Mohammed Sameer + * Copyright (C) 2012-2013 Mohammed Sameer * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,60 +20,61 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -import QtQuick 1.1 -import com.nokia.meego 1.1 -import "ImageSettingsDialog.js" as Util +import QtQuick 2.0 +import QtCamera 1.0 Column { - spacing: 10 + property Camera camera: null - SectionHeader { - text: qsTr("Aspect ratio"); - } + spacing: 10 - ButtonRow { - id: aspectRatioRow - width: parent.width + SectionHeader { + text: qsTr("Aspect ratio") + } - exclusive: false - onCheckedButtonChanged: { - // This is needed to initially setup the - // resolutions buttons - Util.resetAspectRatio(aspectRatioRow); - } + CameraButtonRow { + id: aspectRatioRow + width: parent.width + enabled: camera ? camera.idle : false + exclusive: false - Repeater { - model: imageSettings.aspectRatios - delegate: Button { - property string aspect: modelData; - text: qsTr(modelData); - checked: settings.imageAspectRatio == modelData; - onClicked: Util.setAspectRatio(modelData); - } - } + Repeater { + model: imageSettings.aspectRatios + delegate: CameraButton { + text: qsTr(modelData) + checked: settings.imageAspectRatio == modelData + onClicked: settings.imageAspectRatio = modelData + } } + } - SectionHeader { - text: qsTr("Resolution"); - } + SectionHeader { + text: qsTr("Resolution") + } - ButtonRow { - id: resolutionsRow - width: parent.width + CameraButtonRow { + id: resolutionsRow + width: parent.width + enabled: camera ? camera.idle : false + exclusive: false - exclusive: false + Binding { + target: imageSettings.resolutions + property: "aspectRatio" + value: settings.imageAspectRatio + } - Repeater { - id: resolutions - model: imageSettings.resolutions + Repeater { + id: resolutions + model: imageSettings.resolutions.aspectRatio == settings.imageAspectRatio ? + imageSettings.resolutions : undefined - delegate: Button { - property string resolution: resolutionName - property string aspectRatio: resolutionAspectRatio - text: qsTr("%1 Mpx").arg(megaPixels); - checked: settings.imageResolution == resolutionName - onClicked: Util.setResolution(resolutionName); - } - } + delegate: CameraButton { + font.capitalization: Font.Capitalize + text: qsTr("%1 %2 Mpx").arg(resolutionName).arg(megaPixels) + checked: settings.imageResolution == resolutionName + onClicked: settings.imageResolution = resolutionName + } } + } }