From 090c53898c42e4d95a745dca1c18caae5b405fce Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 19 Dec 2019 16:03:00 -0400 Subject: [PATCH] Fix width for messages with text + image previews The width of the images weren't taken into consideration to calculate the message xOffset, resulting in these messages being pushed way past what they should be and looking very thin --- src/gui/Pages/Chat/Timeline/EventContent.qml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gui/Pages/Chat/Timeline/EventContent.qml b/src/gui/Pages/Chat/Timeline/EventContent.qml index 14bf3425..e25eb541 100644 --- a/src/gui/Pages/Chat/Timeline/EventContent.qml +++ b/src/gui/Pages/Chat/Timeline/EventContent.qml @@ -31,8 +31,16 @@ HRowLayout { readonly property int xOffset: onRight ? - contentLabel.width - contentLabel.paintedWidth - - contentLabel.leftPadding - contentLabel.rightPadding : + Math.min( + contentColumn.width - contentLabel.paintedWidth - + contentLabel.leftPadding - contentLabel.rightPadding, + + contentColumn.width - linksRepeater.widestChild - + ( + pureMedia ? + 0 : contentLabel.leftPadding + contentLabel.rightPadding + ), + ) : 0 // 600px max with a 16px font