diff --git a/src/qml/Chat/Timeline/EventContent.qml b/src/qml/Chat/Timeline/EventContent.qml index fa1fe11c..6f0029dc 100644 --- a/src/qml/Chat/Timeline/EventContent.qml +++ b/src/qml/Chat/Timeline/EventContent.qml @@ -164,32 +164,6 @@ HRowLayout { Layout.preferredWidth: item ? item.width : -1 Layout.preferredHeight: item ? item.height : -1 - - // Layout.minimumWidth: - // type === EventDelegate.Media.Image ? - // (singleMediaInfo.media_width || - // (item ? item.loadingLabel.implicitWidth : -1)) : -1 - - // Layout.minimumHeight: - // type === EventDelegate.Media.Image ? - // (singleMediaInfo.media_height || - // (item ? item.loadingLabel.implicitHeight : -1)) : -1 - - // Layout.minimumWidth: - // type === EventDelegate.Media.File ? - // theme.chat.message.fileMinWidth : -1 - - // Layout.preferredWidth: - // type === EventDelegate.Media.Video ? - // theme.chat.message.videoWidth : - - // type === EventDelegate.Media.Audio ? - // theme.chat.message.audioWidth : - - // -1 - - // Layout.maximumWidth: messageBodyWidth - // Layout.maximumHeight: eventList.height / 2 } } } diff --git a/src/qml/Chat/Timeline/EventFile.qml b/src/qml/Chat/Timeline/EventFile.qml index 1ae404e6..92fdba14 100644 --- a/src/qml/Chat/Timeline/EventFile.qml +++ b/src/qml/Chat/Timeline/EventFile.qml @@ -3,6 +3,12 @@ import QtQuick.Layouts 1.12 import "../../Base" HTile { + width: Math.max( + Math.min(eventContent.messageBodyWidth, + theme.chat.message.fileMinWidth), + Math.min(eventContent.messageBodyWidth, implicitWidth), + ) + onLeftClicked: Qt.openUrlExternally(loader.mediaUrl) onRightClicked: eventDelegate.openContextMenu() diff --git a/src/qml/Chat/Timeline/EventImage.qml b/src/qml/Chat/Timeline/EventImage.qml index be5e954e..e1270327 100644 --- a/src/qml/Chat/Timeline/EventImage.qml +++ b/src/qml/Chat/Timeline/EventImage.qml @@ -6,6 +6,7 @@ HMxcImage { id: image width: fitSize.width height: fitSize.height + horizontalAlignment: Image.AlignLeft animated: loader.singleMediaInfo.media_mime === "image/gif" || Utils.urlExtension(loader.mediaUrl) === "gif"