Item {
id: controller
- property int mode: Camera.ImageMode
+ property int mode: settings.mode
property Camera cam: null
property Item dimmer: null
property alias animationRunning: animation.running
function setMode() {
cam.mode = mode;
- controller.mode = mode;
}
NumberAnimation { target: dimmer; property: "opacity"; from: 0; to: 1; duration: 250; alwaysRunToEnd: true }
NumberAnimation { target: dimmer; property: "opacity"; from: 1; to: 0; duration: 250; alwaysRunToEnd: true }
}
+ onModeChanged: {
+ set(mode);
+ }
+
function set(newMode) {
- if (mode == newMode) {
+ if (cam.mode == newMode) {
return;
}
- animation.start();
-
animation.mode = newMode;
+
+ animation.start();
}
}