From d0bc8f3d0515d5ceec4ccf6e9756cb120998cabb Mon Sep 17 00:00:00 2001 From: Marcus Harrison Date: Thu, 14 Apr 2022 14:29:54 +0200 Subject: [PATCH] Fix mis-aligned user messages In compact mode with userMessagesOnRight, the user avatar disappeared and their messages left space on the right for an avatar that wasn't displayed anymore. --- imports/NeoChat/Component/Timeline/TimelineContainer.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/imports/NeoChat/Component/Timeline/TimelineContainer.qml b/imports/NeoChat/Component/Timeline/TimelineContainer.qml index a5fd4f2d2..afa770e3e 100644 --- a/imports/NeoChat/Component/Timeline/TimelineContainer.qml +++ b/imports/NeoChat/Component/Timeline/TimelineContainer.qml @@ -22,7 +22,10 @@ QQC2.ItemDelegate { readonly property int bubbleMaxWidth: Config.compactLayout && !Config.showAvatarInTimeline ? width : (Config.compactLayout ? width - Kirigami.Units.gridUnit * 2 - Kirigami.Units.largeSpacing * 4 : Math.min(width - Kirigami.Units.gridUnit * 2 - Kirigami.Units.largeSpacing * 6, Kirigami.Units.gridUnit * 20)) - property bool showUserMessageOnRight: Config.showLocalMessagesOnRight && model.author.isLocalUser && !applicationWindow().wideScreen + property bool showUserMessageOnRight: Config.showLocalMessagesOnRight && + model.author.isLocalUser && + !applicationWindow().wideScreen && + !Config.compactLayout signal openExternally() signal replyClicked(string eventID) @@ -78,7 +81,9 @@ QQC2.ItemDelegate { leftMargin: Kirigami.Units.largeSpacing } - visible: model.showAuthor && Config.showAvatarInTimeline && !showUserMessageOnRight + visible: model.showAuthor && + Config.showAvatarInTimeline && + (Config.compactLayout || !showUserMessageOnRight) name: model.author.name ?? model.author.displayName source: visible && model.author.avatarMediaId ? ("image://mxc/" + model.author.avatarMediaId) : "" color: model.author.color