resetCamera() will set needed resolution after resetting camera.
[harmattan/cameraplus] / qml / ImageResolutionSettings.qml
index 17ad2cf..df1b6b1 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-@IMPORT_QT_QUICK@
+import QtQuick 2.0
+import QtCamera 1.0
 
 Column {
+    property Camera camera: null
+
     spacing: 10
 
     SectionHeader {
         text: qsTr("Aspect ratio")
+        visible: aspectRatioRow.visible
     }
 
     CameraButtonRow {
         id: aspectRatioRow
         width: parent.width
-        enabled: cam.idle
+        enabled: camera ? camera.idle : false
         exclusive: false
+        visible: imageSettings.aspectRatioCount > 1
 
         Repeater {
             model: imageSettings.aspectRatios
@@ -47,13 +52,15 @@ Column {
 
     SectionHeader {
         text: qsTr("Resolution")
+        visible: resolutionsRow.visible
     }
 
     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
@@ -67,7 +74,7 @@ Column {
                 imageSettings.resolutions : undefined
 
             delegate: CameraButton {
-                font.capitalization: Font.Capitalize
+                capitalize: true
                 text: qsTr("%1 %2 Mpx").arg(resolutionName).arg(megaPixels)
                 checked: settings.imageResolution == resolutionName
                 onClicked: settings.imageResolution = resolutionName