Added ROI an face detection
[harmattan/cameraplus] / qml / ImagePage.qml
index 792d2c1..53c012b 100644 (file)
@@ -34,19 +34,23 @@ CameraPage {
 
         orientationLock: PageOrientation.LockLandscape
 
+        function cameraError() {
+                mountProtector.unlock();
+        }
+
         function captureImage() {
                 if (!checkBattery()) {
                         showError(qsTr("Not enough battery to capture images."));
                         return;
                 }
 
-                if (!checkDiskSpace()) {
-                        showError(qsTr("Not enough space to capture images."));
+                if (!fileSystem.available) {
+                        showError(qsTr("Camera cannot capture images in mass storage mode."));
                         return;
                 }
 
-                if (!fileSystem.available) {
-                        showError(qsTr("Camera cannot capture images in mass storage mode."));
+                if (!checkDiskSpace()) {
+                        showError(qsTr("Not enough space to capture images."));
                         return;
                 }
 
@@ -76,7 +80,7 @@ CameraPage {
                 height: 75
                 opacity: 0.5
                 onClicked: captureImage();
-                visible: imageMode.canCapture && !cameraMode.animationRunning && !previewAnimationRunning && cam.running
+                visible: imageMode.canCapture && !cameraMode.busy && dimmer.opacity == 0.0 && !previewAnimationRunning && cam.running
 
                 onExited: {
                         if (mouseX <= 0 || mouseY <= 0 || mouseX > width || mouseY > height) {
@@ -108,51 +112,20 @@ CameraPage {
                 onSaved: mountProtector.unlock();
         }
 
-        FlashButton {
-                id: flash
-                visible: controlsVisible
+        Rectangle {
+                id: indicators
                 anchors.top: parent.top
-                anchors.left: parent.left
                 anchors.topMargin: 20
-                anchors.leftMargin: 20
-        }
-
-        ImageSceneButton {
-                id: scene
-                visible: controlsVisible
-                anchors.top: flash.bottom
-                anchors.left: parent.left
-                anchors.topMargin: 10
-                anchors.leftMargin: 20
-        }
-
-        ImageEvCompButton {
-                id: evComp
-                visible: controlsVisible
-                anchors.top: scene.bottom
-                anchors.left: parent.left
-                anchors.topMargin: 10
-                anchors.leftMargin: 20
-        }
-
-        MouseArea {
-                id: indicators
-                anchors.bottom: parent.bottom
-                anchors.bottomMargin: 20
                 anchors.left: parent.left
                 anchors.leftMargin: 20
                 width: 48
                 height: col.height
-                onClicked: openFile("ImageSettingsPage.qml");
+                color: "black"
+                border.color: "gray"
+                radius: 20
+                opacity: 0.5
                 visible: controlsVisible
 
-                BorderImage {
-                        id: image
-                        anchors.fill: parent
-                        smooth: true
-                        source: indicators.pressed ? "image://theme/meegotouch-camera-settings-indicators-background-pressed" : "image://theme/meegotouch-camera-settings-indicators-background"
-                }
-
                 Column {
                         id: col
                         width: parent.width
@@ -196,6 +169,13 @@ CameraPage {
                                         alwaysRunToEnd: true
                                 }
                         }
+
+                        Indicator {
+                                id: faceDetectionIndicator
+                                visible: settings.faceDetectionEnabled
+                                source: "image://theme/icon-m-camera-face-detection-screen"
+                        }
+
                 }
         }
 
@@ -213,4 +193,46 @@ CameraPage {
                 onClicked: openFile("PostCapturePage.qml");
                 visible: controlsVisible
         }
+
+        CameraToolBar {
+                id: toolBar
+                anchors.bottom: parent.bottom
+                anchors.bottomMargin: 20
+                anchors.left: parent.left
+                anchors.leftMargin: 20
+                opacity: 0.5
+                targetWidth: parent.width - (anchors.leftMargin * 2) - (66 * 1.5)
+                visible: controlsVisible
+                expanded: settings.showToolBar
+                onExpandedChanged: settings.showToolBar = expanded;
+
+                items: [
+                FlashButton {
+                        onClicked: toolBar.push(items);
+                },
+                ImageSceneButton {
+                        onClicked: toolBar.push(items);
+                },
+                ImageEvCompButton {
+                        onClicked: toolBar.push(items);
+                },
+                ImageWhiteBalanceButton {
+                        onClicked: toolBar.push(items);
+                },
+                ImageColorFilterButton {
+                        onClicked: toolBar.push(items);
+                },
+                ImageIsoButton {
+                        onClicked: toolBar.push(items);
+                },
+                ToolIcon {
+                        iconSource: "image://theme/icon-m-toolbar-view-menu-white"
+                        onClicked: imageSettingsDialog.open();
+                }
+                ]
+        }
+
+        ImageSettingsDialog {
+                id: imageSettingsDialog
+        }
 }