diff --git a/src/gui/Base/HAvatar.qml b/src/gui/Base/HAvatar.qml index bd6aded4..dc00aeef 100644 --- a/src/gui/Base/HAvatar.qml +++ b/src/gui/Base/HAvatar.qml @@ -66,6 +66,7 @@ Rectangle { sourceSize.width: parent.width sourceSize.height: parent.height fillMode: Image.PreserveAspectCrop + animatedFillMode: AnimatedImage.PreserveAspectCrop animate: false radius: parent.radius @@ -92,6 +93,7 @@ Rectangle { contentItem: HMxcImage { id: avatarToolTipImage fillMode: Image.PreserveAspectCrop + animatedFillMode: AnimatedImage.PreserveAspectCrop mxc: avatarImage.mxc title: avatarImage.title diff --git a/src/gui/Base/HImage.qml b/src/gui/Base/HImage.qml index 82debb32..a0272c14 100644 --- a/src/gui/Base/HImage.qml +++ b/src/gui/Base/HImage.qml @@ -12,6 +12,8 @@ Image { property bool animated: utils.urlExtension(image.source).toLowerCase() === "gif" + property int animatedFillMode: AnimatedImage.PreserveAspectFit + property alias radius: roundMask.radius property alias showProgressBar: progressBarLoader.active @@ -40,7 +42,7 @@ Image { source: image.source autoTransform: image.autoTransform asynchronous: image.asynchronous - fillMode: image.fillMode + fillMode: image.animatedFillMode mirror: image.mirror mipmap: image.mipmap @@ -58,6 +60,11 @@ Image { // Hack to make the non-animated image behind this one // basically invisible + Binding { + target: image + property: "fillMode" + value: Image.Pad + } Binding { target: image property: "sourceSize.width" diff --git a/src/gui/Popups/ConfirmClipboardUploadPopup.qml b/src/gui/Popups/ConfirmClipboardUploadPopup.qml index 1e2132bc..d97d34f8 100644 --- a/src/gui/Popups/ConfirmClipboardUploadPopup.qml +++ b/src/gui/Popups/ConfirmClipboardUploadPopup.qml @@ -54,7 +54,6 @@ HColumnPopup { property int updateCounter: 0 source: "image://clipboard/" + updateCounter - fillMode: Image.PreserveAspectFit sourceSize.width: popup.contentWidthLimit Layout.fillWidth: true diff --git a/src/gui/Popups/ConfirmUploadPopup.qml b/src/gui/Popups/ConfirmUploadPopup.qml index 85879727..41d2a995 100644 --- a/src/gui/Popups/ConfirmUploadPopup.qml +++ b/src/gui/Popups/ConfirmUploadPopup.qml @@ -49,7 +49,6 @@ HColumnPopup { HImage { source: popup.filePath - fillMode: Image.PreserveAspectFit visible: status !== Image.Error sourceSize.width: popup.contentWidthLimit diff --git a/src/gui/UI.qml b/src/gui/UI.qml index 3840018f..a391abb1 100644 --- a/src/gui/UI.qml +++ b/src/gui/UI.qml @@ -116,6 +116,7 @@ Item { id: image visible: Boolean(Qt.resolvedUrl(source)) fillMode: Image.PreserveAspectCrop + animatedFillMode: AnimatedImage.PreserveAspectCrop source: theme.ui.image sourceSize.width: Screen.width sourceSize.height: Screen.height