diff --git a/TODO.md b/TODO.md index 788ed1c4..d196a053 100644 --- a/TODO.md +++ b/TODO.md @@ -19,10 +19,7 @@ - Video: missing buttons and small size problems - Audio: online playback is buggy, must download+play file - - Shrinking the window near its minimum size (seen at 262px) makes - image preview position/padding wrong - In the "Leave me" room, "join > Hi > left" aren't combined - - GIF glitchy border - Combined pure media events time looks bad - RoomMessageNotice diff --git a/src/qml/Chat/Timeline/EventContent.qml b/src/qml/Chat/Timeline/EventContent.qml index 2b0912cb..a08977b0 100644 --- a/src/qml/Chat/Timeline/EventContent.qml +++ b/src/qml/Chat/Timeline/EventContent.qml @@ -145,38 +145,25 @@ HRowLayout { transform: Translate { x: xOffset } - Layout.bottomMargin: contentLabel.bottomPadding * multiply - Layout.leftMargin: contentLabel.leftPadding * multiply - Layout.rightMargin: contentLabel.rightPadding * multiply + Layout.bottomMargin: pureMedia ? 0 : contentLabel.bottomPadding + Layout.leftMargin: pureMedia ? 0 : contentLabel.leftPadding + Layout.rightMargin: pureMedia ? 0 : contentLabel.rightPadding - Layout.minimumWidth: - type === EventDelegate.Media.File ? - theme.chat.message.fileMinWidth : -1 + // Layout.minimumWidth: + // type === EventDelegate.Media.File ? + // theme.chat.message.fileMinWidth : -1 - Layout.preferredWidth: - type === EventDelegate.Media.Image ? - (item ? item.fitSize.width : 0) : + // Layout.preferredWidth: + // type === EventDelegate.Media.Video ? + // theme.chat.message.videoWidth : - type === EventDelegate.Media.Video ? - theme.chat.message.videoWidth : + // type === EventDelegate.Media.Audio ? + // theme.chat.message.audioWidth : - type === EventDelegate.Media.Audio ? - theme.chat.message.audioWidth : + // -1 - -1 - - Layout.maximumWidth: - messageBodyWidth - Layout.leftMargin - Layout.rightMargin - - Layout.maximumHeight: - type === EventDelegate.Media.Image && item ? - Utils.fitSize( - Layout.maximumWidth, - item.fitSize.height, - Layout.maximumWidth - ).height : -1 - - readonly property int multiply: pureMedia ? 0 : 1 + Layout.maximumWidth: messageBodyWidth + Layout.maximumHeight: eventList.height / 1.5 } } } diff --git a/src/qml/Chat/Timeline/EventImage.qml b/src/qml/Chat/Timeline/EventImage.qml index e5258288..42b0ae6b 100644 --- a/src/qml/Chat/Timeline/EventImage.qml +++ b/src/qml/Chat/Timeline/EventImage.qml @@ -4,23 +4,13 @@ import "../../utils.js" as Utils HImage { id: image - sourceSize.width: theme.chat.message.thumbnailWidth - sourceSize.height: theme.chat.message.thumbnailWidth - width: fitSize.width - height: fitSize.height - - // Leaving PreserveAspectFit creates a binding loop, and is uneeded - // since we calculate ourself the right size. - fillMode: Image.Pad + horizontalAlignment: Image.AlignLeft + sourceSize.width: theme.chat.message.thumbnailWidth // FIXME // source = thumbnail, fullSource = full original image property url fullSource: source - readonly property size fitSize: Utils.fitSize( - implicitWidth, implicitHeight, theme.chat.message.thumbnailWidth, - ) - TapHandler { onTapped: if (! image.animated) Qt.openUrlExternally(fullSource)