Implemented EvCompButton
authorMohammed Sameer <msameer@foolab.org>
Sat, 1 Sep 2012 14:13:37 +0000 (17:13 +0300)
committerMohammed Sameer <msameer@foolab.org>
Sat, 1 Sep 2012 14:13:37 +0000 (17:13 +0300)
qml/EvCompButton.qml [new file with mode: 0644]
qml/ImagePage.qml

diff --git a/qml/EvCompButton.qml b/qml/EvCompButton.qml
new file mode 100644 (file)
index 0000000..b7b56c3
--- /dev/null
@@ -0,0 +1,33 @@
+// -*- qml -*-
+import QtQuick 1.1
+import com.nokia.meego 1.1
+import QtCamera 1.0
+
+Selector {
+        id: button
+
+        property alias value: evComp.value
+
+        iconSource: evComp.value == 0 ? "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-manual-exposure.png" : ""
+        text: evComp.value == 0 ? "" : evComp.value.toFixed(1);
+        timerConstraints: slider.pressed
+
+        EvComp {
+                id: evComp
+                camera: cam
+
+                // TODO: hardcoding
+                value: slider.value
+                onValueChanged: console.log(value);
+        }
+
+        widget: Slider {
+                id: slider
+                orientation: Qt.Horizontal
+                minimumValue: evComp.minimum
+                maximumValue: evComp.maximum
+                value: evComp.value
+                stepSize: 0.1
+                Component.onCompleted: { slider.value = evComp.value; }
+        }
+}
index bbcd98d..f233a52 100644 (file)
@@ -46,19 +46,13 @@ CameraPage {
                 anchors.leftMargin: 20
         }
 
-        Selector {
+        EvCompButton {
                 id: evComp
                 visible: capture.visible
                 anchors.top: scene.bottom
                 anchors.left: parent.left
                 anchors.topMargin: 10
                 anchors.leftMargin: 20
-                timerConstraints: slider.pressed
-                widget: Slider {
-                        id: slider
-                        orientation: Qt.Horizontal
-//                        anchors.horizontalCenter: parent.horizontalCenter
-                }
         }
 
         // TODO: filenaming.