From 8ac598886f629a5661ecd2142c5799d9630b4e6a Mon Sep 17 00:00:00 2001 From: armored-dragon Date: Sat, 21 Dec 2024 05:45:59 -0600 Subject: [PATCH] Support animated images. --- .../domainChat/qml_widgets/TemplateChatMessage.qml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/system/domainChat/qml_widgets/TemplateChatMessage.qml b/scripts/system/domainChat/qml_widgets/TemplateChatMessage.qml index a9c366ce76..7829ee791d 100644 --- a/scripts/system/domainChat/qml_widgets/TemplateChatMessage.qml +++ b/scripts/system/domainChat/qml_widgets/TemplateChatMessage.qml @@ -1,4 +1,4 @@ -import QtQuick 2.7 +import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 @@ -147,10 +147,11 @@ Component { width: messageBoxFlow.width; height: 200 - Image { + AnimatedImage { source: model.type === 'imageEmbed' ? model.value : '' - sourceSize.width: 400 - sourceSize.height: 200 + height: Math.min(sourceSize.height, 200); + onStatusChanged: playing = (status == AnimatedImage.Ready) + fillMode: Image.PreserveAspectFit } } }