fix(ProfileHeader): don't overflow the title

- calculate the text width correctly, taking into account all the
contents (verifications icons, edit button) and also the margins

Fixes #14462
This commit is contained in:
Lukáš Tinkl 2024-04-19 00:12:29 +02:00 committed by Lukáš Tinkl
parent 38d6b694fb
commit 78acdca225
1 changed files with 4 additions and 2 deletions

View File

@ -200,7 +200,8 @@ Item {
StyledText {
objectName: "ProfileHeader_displayName"
Layout.maximumWidth: root.width - Style.current.xlPadding
Layout.maximumWidth: root.width - verificationIcons.width - contentContainer.anchors.leftMargin - contentContainer.anchors.rightMargin -
(editButtonLoader.active ? editButtonLoader.item.width : 0)
text: root.displayName
elide: Text.ElideRight
font {
@ -210,7 +211,7 @@ Item {
}
StatusContactVerificationIcons {
Layout.alignment: Qt.AlignVCenter
id: verificationIcons
visible: !root.isCurrentUser && !root.isBridgedAccount
isContact: root.isContact
trustIndicator: root.trustStatus
@ -218,6 +219,7 @@ Item {
}
Loader {
id: editButtonLoader
sourceComponent: SVGImage {
objectName: "ProfileHeader_displayNameEditIcon"
height: compact ? 10 : 16