Support user messages on the right even when wide

Limit maximum delegate width to ensure that the gap between user and non-user messages isn't too large
This commit is contained in:
James Graham
2022-07-03 13:14:08 +01:00
parent c3ee277ede
commit 7dc951d2cd
7 changed files with 3 additions and 11 deletions

View File

@@ -19,12 +19,11 @@ QQC2.ItemDelegate {
property bool isEmote: false
property bool cardBackground: true
readonly property int delegateMaxWidth: Math.min(messageListView.width, Kirigami.Units.gridUnit * 40)
readonly property int bubbleMaxWidth: Config.compactLayout && !Config.showAvatarInTimeline ? width - Kirigami.Units.largeSpacing * 4 : (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 &&
!Config.compactLayout
model.author.isLocalUser && !Config.compactLayout
signal openExternally()
signal replyClicked(string eventID)
@@ -37,6 +36,7 @@ QQC2.ItemDelegate {
topPadding: 0
bottomPadding: 0
width: delegateMaxWidth
background: null
property Item hoverComponent