X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=qml%2FImageResolutionSettings.qml;h=e287394fa6a174b1ac88bdbaafb0f57ffbd3a965;hb=38ae6c17352880f8603d806addba1dfa30b0f5a7;hp=b57570ee00bd56e75295a795bfedcd7d66d42489;hpb=3423bd2565dc32f1a8910a99e1d26a6e977a3f63;p=harmattan%2Fcameraplus diff --git a/qml/ImageResolutionSettings.qml b/qml/ImageResolutionSettings.qml index b57570e..e287394 100644 --- a/qml/ImageResolutionSettings.qml +++ b/qml/ImageResolutionSettings.qml @@ -20,58 +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 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 - enabled: cam.idle - exclusive: false + SectionHeader { + text: qsTr("Aspect ratio") + } - Repeater { - model: imageSettings.aspectRatios - delegate: Button { - text: qsTr(modelData); - checked: settings.imageAspectRatio == modelData; - onClicked: settings.imageAspectRatio = modelData; - } - } - } + CameraButtonRow { + id: aspectRatioRow + width: parent.width + enabled: camera ? camera.idle : false + exclusive: false - SectionHeader { - text: qsTr("Resolution"); + Repeater { + model: imageSettings.aspectRatios + delegate: CameraButton { + text: qsTr(modelData) + checked: settings.imageAspectRatio == modelData + onClicked: settings.imageAspectRatio = modelData + } } + } - ButtonRow { - id: resolutionsRow - width: parent.width - enabled: cam.idle - exclusive: false + SectionHeader { + text: qsTr("Resolution") + } - Binding { - target: imageSettings.resolutions - property: "aspectRatio" - value: settings.imageAspectRatio - } + CameraButtonRow { + id: resolutionsRow + width: parent.width + enabled: camera ? camera.idle : false + exclusive: false + + Binding { + target: imageSettings.resolutions + property: "aspectRatio" + value: settings.imageAspectRatio + } - Repeater { - id: resolutions - model: imageSettings.resolutions.aspectRatio == settings.imageAspectRatio ? imageSettings.resolutions : undefined + Repeater { + id: resolutions + model: imageSettings.resolutions.aspectRatio == settings.imageAspectRatio ? + imageSettings.resolutions : undefined - delegate: Button { - font.capitalization: Font.Capitalize - text: qsTr("%1 %2 Mpx").arg(resolutionName).arg(megaPixels); - checked: settings.imageResolution == resolutionName - onClicked: settings.imageResolution = resolutionName; - } - } + delegate: CameraButton { + font.capitalization: Font.Capitalize + text: qsTr("%1 %2 Mpx").arg(resolutionName).arg(megaPixels) + checked: settings.imageResolution == resolutionName + onClicked: settings.imageResolution = resolutionName + } } + } }