X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=qml%2FPreviewImage.qml;h=52a32f3b73f9a4479289672f4a381115e9104f22;hb=9de4fed0ac3310c4faccc9f2fa60fc6ee5f48895;hp=eee31ddb9a378a3e6496fc1b9fba423ca36e395c;hpb=3ebdbc119f7fa281fae23c509778e3b614390fdf;p=harmattan%2Fcameraplus diff --git a/qml/PreviewImage.qml b/qml/PreviewImage.qml index eee31dd..52a32f3 100644 --- a/qml/PreviewImage.qml +++ b/qml/PreviewImage.qml @@ -3,7 +3,7 @@ /*! * This file is part of CameraPlus. * - * Copyright (C) 2012 Mohammed Sameer + * Copyright (C) 2012-2013 Mohammed Sameer * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,36 +20,45 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -import QtQuick 1.1 +@IMPORT_QT_QUICK@ import com.nokia.meego 1.1 import QtCamera 1.0 Image { - id: image - anchors.fill: parent - property alias animationRunning: animation.running - opacity: 0 - z: 1 + id: image + anchors.fill: parent + property alias animationRunning: animation.running - visible: opacity != 0 + visible: opacity != 0 - cache: false - fillMode: Image.PreserveAspectFit + cache: false + fillMode: Image.PreserveAspectFit - MouseArea { - anchors.fill: parent - enabled: parent.visible - } + MouseArea { + anchors.fill: parent + enabled: parent.visible + } - SequentialAnimation { - id: animation - PauseAnimation { duration: 500; alwaysRunToEnd: true } - NumberAnimation { target: preview; property: "opacity"; from: 1; to: 0; duration: 250; alwaysRunToEnd: true } + SequentialAnimation { + id: animation + PauseAnimation { + duration: 500 + alwaysRunToEnd: true } - function setPreview(preview) { - animation.start(); - image.source = preview; - image.visible = true; + NumberAnimation { + target: preview + property: "opacity" + from: 1 + to: 0 + duration: 250 + alwaysRunToEnd: true } + } + + function setPreview(preview) { + image.source = preview + image.opacity = 1 + animation.start() + } }