X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=qml%2FPostCaptureItem.qml;h=abe6fa924d7d2c8d7a8625ba5aba2be167e68360;hb=13a75630aac35cbdd5751fd583329a790c1a8dfd;hp=4d925b092887afda4641f1e0e6665b2f052da6fb;hpb=8a3b1e7e658ab0aa0288b1501b09f534e660c9ae;p=harmattan%2Fcameraplus diff --git a/qml/PostCaptureItem.qml b/qml/PostCaptureItem.qml index 4d925b0..abe6fa9 100644 --- a/qml/PostCaptureItem.qml +++ b/qml/PostCaptureItem.qml @@ -20,16 +20,18 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -@IMPORT_QT_QUICK@ +import QtQuick 2.0 import CameraPlus 1.0 Item { id: postCaptureItem + property bool isVideo: itemData.type.search("nmm#Video") > 0 property alias error: image.error property variant itemData: item property bool playing: loader.source != "" signal clicked + clip: true function startPlayback() { loader.source = Qt.resolvedUrl("VideoPlayerPage.qml") @@ -56,16 +58,41 @@ Item { onFinished: loader.source = "" } -// TODO: rotation FullScreenThumbnail { id: image source: itemData.url mimeType: itemData.mimeType - - width: parent.width - 10 - height: parent.height + rotation: calculateRotation(orientation.orientation) + width: isPortrait ? parent.height : parent.width - 10 + height: isPortrait ? parent.width - 10 : parent.height anchors.centerIn: parent visible: loader.source == "" + property bool isPortrait: rotation == -90 + + Behavior on width { + PropertyAnimation { duration: 100 } + } + + Behavior on height { + PropertyAnimation { duration: 100 } + } + + Behavior on rotation { + PropertyAnimation { duration: 100 } + } + + function calculateRotation(orientation) { + switch (orientation) { + case CameraOrientation.InvertedLandscape: + case CameraOrientation.Landscape: + return 0 + case CameraOrientation.InvertedPortrait: + case CameraOrientation.Portrait: + return -90 + default: + return 0 + } + } MouseArea { id: mouse @@ -91,7 +118,7 @@ Item { CameraToolIcon { id: playIcon anchors.horizontalCenter: parent.horizontalCenter - iconSource: "image://theme/icon-s-music-video-play" + iconId: cameraTheme.videoPlayIconId visible: isVideo onClicked: startPlayback() }