Disable zoom button and proximity sensor if we are not in capture mode
authorMohammed Sameer <msameer@foolab.org>
Sun, 25 Aug 2013 17:19:07 +0000 (20:19 +0300)
committerMohammed Sameer <msameer@foolab.org>
Sun, 25 Aug 2013 17:19:07 +0000 (20:19 +0300)
This prevents accidental capture when we are in either post capture or settings views.

qml/MainPage.qml
qml/PostCaptureView.qml

index 151b55a..e1b7fd7 100644 (file)
@@ -30,6 +30,7 @@ CameraPage {
     id: root
 
     property bool deviceChangeInProgress: false
+    property bool inCaptureMode: mainView.currentIndex == 1
 
     CameraTheme {
         id: cameraTheme
@@ -272,19 +273,19 @@ CameraPage {
 
     DeviceKeys {
         id: keys
-        active: Qt.application.active && pipelineManager.scaleAcquired
+        active: Qt.application.active && pipelineManager.scaleAcquired && root.inCaptureMode && !mainView.moving
         repeat: !settings.zoomAsShutter
     }
 
     CameraProximitySensor {
         id: proximitySensor
-        active: Qt.application.active && viewfinder.camera.running && settings.proximityAsShutter
+        active: Qt.application.active && viewfinder.camera.running && settings.proximityAsShutter && root.inCaptureMode && !mainView.moving
     }
 
     // TODO:
     Standby {
         policyLost: pipelineManager.state == "policyLost"
         show: !Qt.application.active || pipelineManager.showStandBy ||
-            (mainView.currentIndex == 1 && !viewfinder.camera.running)
+            (inCaptureMode && !viewfinder.camera.running)
     }
 }
index a8a28a5..0b18824 100644 (file)
@@ -36,7 +36,7 @@ Item {
         CameraResources.Image
 
     property bool isCurrent: mainView.currentIndex == 2 && !mainView.moving
-    property bool inCameraMode: mainView.currentIndex == 1 && !mainView.moving
+    property bool inCameraMode: root.inCaptureMode && !mainView.moving
 
     onIsCurrentChanged: {
         if (isCurrent) {