From 058e8034d9a4ba452ee4b67d4a5beb1875ec3704 Mon Sep 17 00:00:00 2001 From: James Graham Date: Tue, 27 Sep 2022 20:33:38 +0100 Subject: [PATCH] Make sure that contentMaxWidth is used instead of bubbleMaxWidth for the message delegate. --- imports/NeoChat/Component/Timeline/MessageDelegate.qml | 3 ++- imports/NeoChat/Component/Timeline/ReplyComponent.qml | 2 +- imports/NeoChat/Component/Timeline/RichLabel.qml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/imports/NeoChat/Component/Timeline/MessageDelegate.qml b/imports/NeoChat/Component/Timeline/MessageDelegate.qml index 923a0646e..6987871b9 100644 --- a/imports/NeoChat/Component/Timeline/MessageDelegate.qml +++ b/imports/NeoChat/Component/Timeline/MessageDelegate.qml @@ -20,13 +20,14 @@ TimelineContainer { hoverComponent: hoverActions innerObject: ColumnLayout { + Layout.maximumWidth: messageDelegate.contentMaxWidth RichLabel { id: label isEmote: messageDelegate.isEmote - Layout.maximumWidth: messageDelegate.bubbleMaxWidth } Loader { id: linkPreviewLoader + Layout.fillWidth: true height: active ? item.implicitHeight : 0 active: !currentRoom.usesEncryption && model.display && model.display.includes("http") visible: active diff --git a/imports/NeoChat/Component/Timeline/ReplyComponent.qml b/imports/NeoChat/Component/Timeline/ReplyComponent.qml index fb22f799e..acf4170b5 100644 --- a/imports/NeoChat/Component/Timeline/ReplyComponent.qml +++ b/imports/NeoChat/Component/Timeline/ReplyComponent.qml @@ -15,7 +15,7 @@ MouseArea { id: replyButton Layout.fillWidth: true implicitHeight: replyName.implicitHeight + (loader.item ? loader.item.height : 0) + Kirigami.Units.largeSpacing - implicitWidth: Math.min(contentMaxWidth, Math.max((loader.item ? loader.item.width + Kirigami.Units.largeSpacing + Kirigami.Units.smallSpacing : 0), replyName.implicitWidth)) + Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 3 + implicitWidth: Math.min(contentMaxWidth, Math.max((loader.item ? loader.item.width : 0), replyName.implicitWidth)) + Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing Component.onCompleted: { parent.Layout.fillWidth = true; parent.Layout.preferredWidth = Qt.binding(function() { return implicitWidth; }) diff --git a/imports/NeoChat/Component/Timeline/RichLabel.qml b/imports/NeoChat/Component/Timeline/RichLabel.qml index 93fc77edc..5d2149c93 100644 --- a/imports/NeoChat/Component/Timeline/RichLabel.qml +++ b/imports/NeoChat/Component/Timeline/RichLabel.qml @@ -20,7 +20,7 @@ TextEdit { ListView.onReused: Qt.binding(() => !hasSpoiler.test(textMessage)) - Layout.fillWidth: Config.compactLayout + Layout.fillWidth: true persistentSelection: true