From 3607ca98a00fcb909ada58b5c2b9d7b47248a5d7 Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Tue, 10 Nov 2020 21:11:25 +0100 Subject: [PATCH] Fix flickering image during resize on chat information page --- qml/components/ProfileThumbnail.qml | 5 +++-- .../chatInformationPage/ChatInformationProfilePicture.qml | 1 + qml/pages/ChatInformationPage.qml | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qml/components/ProfileThumbnail.qml b/qml/components/ProfileThumbnail.qml index d1ae116..04f7cf9 100644 --- a/qml/components/ProfileThumbnail.qml +++ b/qml/components/ProfileThumbnail.qml @@ -29,6 +29,7 @@ Item { property string replacementStringHint: "X" property int radius: width / 2 property int imageStatus: -1 + property bool optimizeImageSize: true function getReplacementString() { if (replacementStringHint.length > 2) { @@ -67,8 +68,8 @@ Item { height: width anchors.centerIn: parent source: file.path - sourceSize.width: width - sourceSize.height: height + sourceSize.width: optimizeImageSize ? width : undefined + sourceSize.height: optimizeImageSize ? height : undefined fillMode: Image.PreserveAspectCrop autoTransform: true asynchronous: true diff --git a/qml/components/chatInformationPage/ChatInformationProfilePicture.qml b/qml/components/chatInformationPage/ChatInformationProfilePicture.qml index 2c7fff8..6bdb47d 100644 --- a/qml/components/chatInformationPage/ChatInformationProfilePicture.qml +++ b/qml/components/chatInformationPage/ChatInformationProfilePicture.qml @@ -32,6 +32,7 @@ Item { photoData: (typeof chatInformation.photo !== "undefined") ? chatInformation.photo.big : "" replacementStringHint: "" radius: chatPictureThumbnail.radius + optimizeImageSize: false } MouseArea { diff --git a/qml/pages/ChatInformationPage.qml b/qml/pages/ChatInformationPage.qml index 1d2efd5..6efc4d0 100644 --- a/qml/pages/ChatInformationPage.qml +++ b/qml/pages/ChatInformationPage.qml @@ -260,6 +260,7 @@ Page { height: width radius: imageContainer.minDimension / 2 opacity: profilePictureLoader.status !== Loader.Ready || profilePictureLoader.item.opacity < 1 ? 1.0 : 0.0 + optimizeImageSize: false } Loader { id: profilePictureLoader