Added a button to enable/disable video torch
authorMohammed Sameer <msameer@foolab.org>
Sat, 1 Sep 2012 16:20:57 +0000 (19:20 +0300)
committerMohammed Sameer <msameer@foolab.org>
Sat, 1 Sep 2012 16:20:57 +0000 (19:20 +0300)
qml/VideoPage.qml
qml/VideoTorchButton.qml [new file with mode: 0644]

index a282249..8a3913d 100644 (file)
@@ -36,4 +36,14 @@ CameraPage {
                 camera: cam
                 onPreviewAvailable: page.setPreview(preview);
         }
+
+        VideoTorchButton {
+                id: torch
+                visible: controlsVisible
+                anchors.top: parent.top
+                anchors.left: parent.left
+                anchors.topMargin: 20
+                anchors.leftMargin: 20
+        }
+
 }
diff --git a/qml/VideoTorchButton.qml b/qml/VideoTorchButton.qml
new file mode 100644 (file)
index 0000000..3d890c3
--- /dev/null
@@ -0,0 +1,18 @@
+// -*- qml -*-
+import QtQuick 1.1
+import com.nokia.meego 1.1
+import QtCamera 1.0
+
+Button {
+        id: button
+        width: 64
+        height: 64
+        opacity: 0.5
+
+        iconSource: torch.on ? "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-torch-on.png" : "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-torch-off.png"
+        onClicked: torch.on = !torch.on
+        VideoTorch {
+                id: torch
+                camera: cam
+        }
+}