diff --git a/ui/app/AppLayouts/Chat/components/MessageContextMenu.qml b/ui/app/AppLayouts/Chat/components/MessageContextMenu.qml index 38278065ee..1bc4e7d454 100644 --- a/ui/app/AppLayouts/Chat/components/MessageContextMenu.qml +++ b/ui/app/AppLayouts/Chat/components/MessageContextMenu.qml @@ -86,9 +86,11 @@ PopupMenu { StyledText { id: username - text: Utils.truncateName(Utils.removeStatusEns(userName)) + text: Utils.removeStatusEns(userName) + elide: Text.ElideRight + maximumLineCount: 3 horizontalAlignment: Text.AlignHCenter - wrapMode: Text.WordWrap + wrapMode: Text.Wrap anchors.top: profileImage.bottom anchors.topMargin: 4 anchors.left: parent.left diff --git a/ui/app/AppLayouts/Chat/components/ProfilePopup.qml b/ui/app/AppLayouts/Chat/components/ProfilePopup.qml index 20fb693059..af5938c555 100644 --- a/ui/app/AppLayouts/Chat/components/ProfilePopup.qml +++ b/ui/app/AppLayouts/Chat/components/ProfilePopup.qml @@ -65,22 +65,23 @@ ModalPopup { source: identicon } - StyledTextEdit { + StyledText { id: profileName - text: Utils.truncateName(Utils.removeStatusEns(userName)) + text: Utils.removeStatusEns(userName) + elide: Text.ElideRight anchors.top: parent.top anchors.topMargin: Style.current.padding anchors.left: profilePic.right anchors.leftMargin: Style.current.halfPadding + anchors.right: qrCodeButton.left + anchors.rightMargin: Style.current.padding font.bold: true font.pixelSize: 17 - readOnly: true - wrapMode: Text.WordWrap } StyledText { - text: isEnsVerified ? Utils.truncateName(alias) : fromAuthor - elide: !isEnsVerified ? Text.ElideMiddle : Text.ElideNone + text: isEnsVerified ? alias : fromAuthor + elide: !isEnsVerified ? Text.ElideMiddle : Text.ElideRight anchors.left: profilePic.right anchors.leftMargin: Style.current.smallPadding anchors.bottom: parent.bottom diff --git a/ui/imports/Utils.qml b/ui/imports/Utils.qml index 4b580acb0d..c48e015915 100644 --- a/ui/imports/Utils.qml +++ b/ui/imports/Utils.qml @@ -74,14 +74,6 @@ QtObject { return userName.endsWith(".stateofus.eth") ? userName.substr(0, userName.length - 14) : userName } - function truncateName(name, num = 32) { - if (name.length <= num) { - return name; - } - - return name.slice(0, num) + "..."; - } - function isValidAddress(inputValue) { return inputValue !== "0x" && /^0x[a-fA-F0-9]{40}$/.test(inputValue) }