property bool pressed: capture.pressed || zoomSlider.pressed || modeButton.pressed
property bool controlsVisible: imageMode.canCapture && cam.running && !animationRunning
&& dimmer.opacity == 0.0 && !cameraMode.busy
+ property bool inhibitDim: false
signal previewAvailable(string uri)
width: 75
height: 75
opacity: 0.5
- onClicked: captureImage()
- visible: controlsVisible && (!settings.zoomAsShutter && keys.active)
+ visible: controlsVisible
onExited: {
if (mouseX <= 0 || mouseY <= 0 || mouseX > width || mouseY > height) {
// Release outside the button:
- stopAutoFocus()
+ captureControl.canceled = true
}
}
}
Timer {
id: autoFocusTimer
interval: 200
- running: capture.pressed || zoomCapture.zoomPressed
+ running: captureControl.state == "capturing"
repeat: false
onTriggered: {
if (cam.autoFocus.cafStatus != AutoFocus.Success) {
ZoomCaptureButton {
id: zoomCapture
- onReleased: parent.captureImage()
}
- ZoomCaptureCancel {
+ CaptureControl {
+ id: captureControl
+ capturePressed: capture.pressed
+ zoomPressed: zoomCapture.zoomPressed
+ proximityClosed: proximitySensor.close
+ onStartCapture: captureImage()
+ onCancelCapture: stopAutoFocus()
+ }
+
+ CaptureCancel {
anchors.fill: parent
- zoomCapture: zoomCapture
- onCanceled: {
- if (!autoFocusTimer.running) {
- stopAutoFocus()
- }
- }
+ enabled: captureControl.showCancelBanner
+ onPressed: captureControl.canceled = true
}
CameraToolBar {
tools: CameraToolBarTools {
FlashButton {
onClicked: toolBar.push(tools)
+ visible: !overlay.cam.quirks.hasQuirk(Quirks.NoFlash)
}
ImageSceneButton {
Indicator {
id: flashIndicator
- visible: !toolBar.expanded
+ visible: !toolBar.expanded && !overlay.cam.quirks.hasQuirk(Quirks.NoFlash)
source: cameraTheme.flashIcon(settings.imageFlashMode)
}
anchors.rightMargin: 5
anchors.topMargin: 5
anchors.bottomMargin: 5
- property string mp: imageSettings.currentResolutionMegapixel == "" ? "?" : imageSettings.currentResolutionMegapixel
- text: qsTr("%1M").arg(mp)
+ text: imageSettings.currentResolution ? qsTr("%1M").arg(imageSettings.currentResolution.megaPixels) : qsTr("?M")
font.bold: true
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
function startAutoFocus() {
- if (cam.device == 0) {
+ if (!overlay.cam.quirks.hasQuirk(Quirks.NoAutoFocus)) {
cam.autoFocus.startAutoFocus()
}
}
function stopAutoFocus() {
- if (cam.device == 0) {
- cam.autoFocus.stopAutoFocus()
+ if (!overlay.cam.quirks.hasQuirk(Quirks.NoAutoFocus)) {
+ if (!autoFocusTimer.running) {
+ cam.autoFocus.stopAutoFocus()
+ }
}
}
+ function resetToolBar() {
+ if (toolBar.depth() > 1) {
+ toolBar.pop()
+ }
+ }
+
+ function cameraDeviceChanged() {
+ resetToolBar()
+ }
}