Fix username label eliding loop

qt66
Nicolas Werner 1 year ago
parent d2c616ee67
commit b1c2b384c6
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 12
      resources/qml/MessageView.qml
  2. 4
      resources/qml/dialogs/ReadReceipts.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

@ -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

Loading…
Cancel
Save