Activated the option to disable capture previews
[harmattan/cameraplus] / qml / VideoOverlay.qml
index df63c91..2d55bb7 100644 (file)
@@ -35,6 +35,7 @@ Item {
         && dimmer.opacity == 0.0 && !cameraMode.busy
     property bool pressed: overlay.recording || capture.pressed ||
         zoomSlider.pressed || modeButton.pressed
+    property bool inhibitDim: recording
 
     signal previewAvailable(string uri)
 
@@ -43,6 +44,7 @@ Item {
     VideoMode {
         id: videoMode
         camera: cam
+        enablePreview: settings.enablePreview
         onPreviewAvailable: overlay.previewAvailable(preview)
     }
 
@@ -66,13 +68,20 @@ Item {
 
     ZoomCaptureButton {
         id: zoomCapture
-        onReleased: overlay.toggleRecording()
+    }
+
+    CaptureControl {
+        id: captureControl
+        capturePressed: capture.pressed
+        zoomPressed: zoomCapture.zoomPressed
+        proximityClosed: proximitySensor.sensorClosed
+        onStartCapture: overlay.toggleRecording()
     }
 
     CaptureCancel {
         anchors.fill: parent
-        enabled: zoomCapture.zoomPressed
-        onPressed: zoomCapture.zoomPressed = false
+        enabled: captureControl.showCancelBanner
+        onPressed: captureControl.canceled = true
     }
 
     CaptureButton {
@@ -85,9 +94,14 @@ Item {
         height: 75
         opacity: 0.5
 
-        onClicked: overlay.toggleRecording()
+        visible: controlsVisible
 
-        visible: controlsVisible && (!settings.zoomAsShutter && keys.active)
+        onExited: {
+            if (mouseX <= 0 || mouseY <= 0 || mouseX > width || mouseY > height) {
+                // Release outside the button:
+                captureControl.canceled = true
+            }
+        }
     }
 
     CameraToolBar {
@@ -105,11 +119,11 @@ Item {
         tools: CameraToolBarTools {
             VideoTorchButton {
                 camera: cam
-                visible: !overlay.cam.quirks.hasQuirk(Quirks.NoVideoTorch)
+                visible: overlay.cam ? !overlay.cam.quirks.hasQuirk(Quirks.NoVideoTorch) : false
             }
 
             VideoSceneButton {
-                property bool hide: (overlay.recording && overlay.cam.quirks.hasQuirk(Quirks.NoSceneModeChangeDuringRecording)) || overlay.cam.quirks.hasQuirk(Quirks.NoNightSceneMode)
+                property bool hide: overlay.cam ? (overlay.recording && overlay.cam.quirks.hasQuirk(Quirks.NoSceneModeChangeDuringRecording)) || overlay.cam.quirks.hasQuirk(Quirks.NoNightSceneMode) : false
                 visible: !hide
                 onClicked: toolBar.push(tools)
             }
@@ -191,10 +205,6 @@ Item {
         }
     }
 
-    DisplayState {
-        inhibitDim: overlay.recording
-    }
-
     Connections {
         target: Qt.application
         onActiveChanged: {