Show animated images

Use animated images in imageDelegate and FullScreenImage so that animated images can be viewed.

Note webp animated images don't work this is a bug with qt see https://bugreports.qt.io/browse/QTBUG-70245
This commit is contained in:
James Graham
2022-11-12 14:42:20 +00:00
parent bb8db23057
commit 815ec1b30e
2 changed files with 5 additions and 2 deletions

View File

@@ -204,7 +204,7 @@ Popup {
Layout.bottomMargin: Kirigami.Units.largeSpacing Layout.bottomMargin: Kirigami.Units.largeSpacing
clip: true clip: true
Image { AnimatedImage {
id: image id: image
property var scaleFactor: 1 property var scaleFactor: 1

View File

@@ -28,7 +28,7 @@ TimelineContainer {
readonly property var maxWidth: Kirigami.Units.gridUnit * 30 readonly property var maxWidth: Kirigami.Units.gridUnit * 30
innerObject: Image { innerObject: AnimatedImage {
id: img id: img
Layout.maximumWidth: Math.min(imageDelegate.contentMaxWidth, imageDelegate.maxWidth) Layout.maximumWidth: Math.min(imageDelegate.contentMaxWidth, imageDelegate.maxWidth)
@@ -87,6 +87,7 @@ TimelineContainer {
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
onTapped: { onTapped: {
img.ToolTip.hide() img.ToolTip.hide()
img.paused = true
fullScreenImage.open() fullScreenImage.open()
} }
} }
@@ -99,6 +100,8 @@ TimelineContainer {
imageWidth: content.info.w imageWidth: content.info.w
imageHeight: content.info.h imageHeight: content.info.h
modelData: model modelData: model
onClosed: img.paused = false
} }
function downloadAndOpen() { function downloadAndOpen() {