summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-06-03 00:30:44 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-06-08 22:32:10 +0200
commitb1c2b384c6649b3d6604760f2b20f45f84d6e19f (patch)
tree0472095cb3b30a133759b097a4d2875d3902e3f4 /resources/qml
parentFix request for empty image (diff)
downloadnheko-b1c2b384c6649b3d6604760f2b20f45f84d6e19f.tar.xz
Fix username label eliding loop
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/MessageView.qml12
-rw-r--r--resources/qml/dialogs/ReadReceipts.qml4
2 files changed, 11 insertions, 5 deletions
diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml
index a38a2f49..e80770bb 100644
--- a/resources/qml/MessageView.qml
+++ b/resources/qml/MessageView.qml
@@ -572,17 +572,23 @@ Item {
                         rightInset: 0
                         rightPadding: 0
 
-                        contentItem: ElidedLabel {
+                        contentItem: Label {
                             id: userName_
 
                             color: TimelineManager.userColor(userId, palette.base)
-                            elideWidth: Math.min(userInfo.remainingWidth - Math.min(statusMsg.implicitWidth, userInfo.remainingWidth / 3), userName_.fullTextWidth)
-                            fullText: userName
+                            text: TimelineManager.escapeEmoji(userNameTextMetrics.elidedText)
                             textFormat: Text.RichText
                         }
 
                         onClicked: room.openUserProfile(userId)
 
+                        TextMetrics {
+                            id: userNameTextMetrics
+
+                            elide: Text.ElideRight
+                            elideWidth: userInfo.remainingWidth - Math.min(statusMsg.implicitWidth, userInfo.remainingWidth / 3)
+                            text: userName
+                        }
                         CursorShape {
                             anchors.fill: parent
                             cursorShape: Qt.PointingHandCursor
diff --git a/resources/qml/dialogs/ReadReceipts.qml b/resources/qml/dialogs/ReadReceipts.qml
index 83b8b8af..523b47cb 100644
--- a/resources/qml/dialogs/ReadReceipts.qml
+++ b/resources/qml/dialogs/ReadReceipts.qml
@@ -91,7 +91,7 @@ ApplicationWindow {
                             Layout.fillWidth: true
 
                             ElidedLabel {
-                                text: model.displayName
+                                fullText: model.displayName
                                 color: TimelineManager.userColor(model ? model.mxid : "", palette.window)
                                 font.pointSize: fontMetrics.font.pointSize
                                 elideWidth: del.width - Nheko.paddingMedium - avatar.width
@@ -99,7 +99,7 @@ ApplicationWindow {
                             }
 
                             ElidedLabel {
-                                text: model.timestamp
+                                fullText: model.timestamp
                                 color: palette.buttonText
                                 font.pointSize: fontMetrics.font.pointSize * 0.9
                                 elideWidth: del.width - Nheko.paddingMedium - avatar.width