Improve ImageDelegate.

This commit is contained in:
Black Hat
2019-05-01 10:59:09 +08:00
parent 7458ebf59a
commit a3d212fa7f
3 changed files with 63 additions and 22 deletions

View File

@@ -2,9 +2,8 @@ import QtQuick 2.12
import QtQuick.Controls 2.12
ApplicationWindow {
property url imageUrl
property int sourceWidth
property int sourceHeight
property string eventId
property url localPath
id: root
@@ -12,16 +11,25 @@ ApplicationWindow {
visible: true
visibility: Qt.WindowFullScreen
title: "Image View - " + imageUrl
title: "Image View - " + eventId
color: "#BB000000"
Image {
Shortcut {
sequence: "Escape"
onActivated: root.destroy()
}
AnimatedImage {
anchors.centerIn: parent
sourceSize.width: root.sourceWidth
sourceSize.height: root.sourceHeight
source: imageUrl
width: Math.min(sourceSize.width, root.width)
height: Math.min(sourceSize.height, root.height)
fillMode: Image.PreserveAspectFit
cache: false
source: localPath
}
ItemDelegate {