summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2014-03-13 19:34:26 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-21 19:21:35 +0100
commit904881d4a338b6259bb18320b0d09f79abe2aa5e (patch)
tree2ccb567aa49512bcb7bf88d3a089465648f5679c /examples
parent023c6ebcb9d990042f0e9a750fd6238d22001022 (diff)
downloadqtmultimedia-904881d4a338b6259bb18320b0d09f79abe2aa5e.tar.gz
qtmultimedia-904881d4a338b6259bb18320b0d09f79abe2aa5e.tar.bz2
qtmultimedia-904881d4a338b6259bb18320b0d09f79abe2aa5e.zip
Improved declarative-camera example.
- Fix setting the white balance preset, it was never actually set on the camera - Improved the zoom control style Change-Id: I95c2851e5ad8409dd79306492271f221a61cb10d Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/multimedia/declarative-camera/PhotoCaptureControls.qml1
-rw-r--r--examples/multimedia/declarative-camera/ZoomControl.qml39
2 files changed, 20 insertions, 20 deletions
diff --git a/examples/multimedia/declarative-camera/PhotoCaptureControls.qml b/examples/multimedia/declarative-camera/PhotoCaptureControls.qml
index 991a46e1..2cd39b8c 100644
--- a/examples/multimedia/declarative-camera/PhotoCaptureControls.qml
+++ b/examples/multimedia/declarative-camera/PhotoCaptureControls.qml
@@ -110,6 +110,7 @@ FocusScope {
text: "Fluorescent"
}
}
+ onValueChanged: captureControls.camera.imageProcessing.whiteBalanceMode = wbModesButton.value
}
CameraButton {
diff --git a/examples/multimedia/declarative-camera/ZoomControl.qml b/examples/multimedia/declarative-camera/ZoomControl.qml
index 1bfda750..48199b58 100644
--- a/examples/multimedia/declarative-camera/ZoomControl.qml
+++ b/examples/multimedia/declarative-camera/ZoomControl.qml
@@ -47,6 +47,8 @@ Item {
property real maximumZoom : 1
signal zoomTo(real value)
+ visible: zoomControl.maximumZoom > 1
+
MouseArea {
id : mouseArea
anchors.fill: parent
@@ -61,7 +63,7 @@ Item {
onPositionChanged: {
if (pressed) {
- var target = initialZoom * Math.pow(2, (initialPos-mouseY)/zoomControl.height);
+ var target = initialZoom * Math.pow(5, (initialPos-mouseY)/zoomControl.height);
target = Math.max(1, Math.min(target, zoomControl.maximumZoom))
zoomControl.zoomTo(target)
}
@@ -74,45 +76,42 @@ Item {
y : parent.height/4
width : 24
height : parent.height/2
- opacity : 0
Rectangle {
anchors.fill: parent
smooth: true
radius: 8
- border.color: "black"
+ border.color: "white"
border.width: 2
- color: "white"
+ color: "black"
opacity: 0.3
}
Rectangle {
+ id: groove
x : 0
y : parent.height * (1.0 - (zoomControl.currentZoom-1.0) / (zoomControl.maximumZoom-1.0))
width: parent.width
height: parent.height - y
smooth: true
radius: 8
- color: "black"
+ color: "white"
opacity: 0.5
}
- states: State {
- name: "ShowBar"
- when: mouseArea.pressed || zoomControl.currentZoom > 1.0
- PropertyChanges { target: bar; opacity: 1 }
- }
-
- transitions: [
- Transition {
- to : "ShowBar"
- NumberAnimation { properties: "opacity"; duration: 100 }
- },
- Transition {
- from : "ShowBar"
- NumberAnimation { properties: "opacity"; duration: 500 }
+ Text {
+ id: zoomText
+ anchors {
+ left: bar.right; leftMargin: 16
}
- ]
+ y: Math.min(parent.height - height, Math.max(0, groove.y - height / 2))
+ text: "x" + Math.round(zoomControl.currentZoom * 100) / 100
+ font.bold: true
+ color: "white"
+ style: Text.Raised; styleColor: "black"
+ opacity: 0.85
+ font.pixelSize: 18
+ }
}
}