fix(ProfilePopup): fix chatkey and contact icons in the header

Fixes #6396
Fixes #6398

- fix displaying the chatkey and the copy button next to it using layouts
- hide the mutual contact and verified contact icons in case of My
profile
This commit is contained in:
Lukáš Tinkl 2022-07-11 11:38:39 +02:00 committed by Lukáš Tinkl
parent 585a628b67
commit c14ff47af8
2 changed files with 13 additions and 15 deletions

View File

@ -24,6 +24,7 @@ Item {
property string icon
property int trustStatus
property bool isContact: false
property bool isCurrentUser
property int imageSize: ProfileHeader.ImageSize.Compact
property bool displayNameVisible: true
@ -113,8 +114,7 @@ Item {
}
}
Row {
width: 380
RowLayout {
spacing: Style.current.halfPadding
Layout.alignment: Qt.AlignHCenter
visible: root.displayNamePlusIconsVisible
@ -132,7 +132,8 @@ Item {
width: 16
source: Style.svg("contact")
}
active: isContact
active: isContact && !root.isCurrentUser
visible: active
}
Loader {
@ -142,7 +143,8 @@ Item {
height: 16
width: 16
}
active: root.trustStatus !== Constants.trustStatus.unknown
active: root.trustStatus !== Constants.trustStatus.unknown && !root.isCurrentUser
visible: active
}
SVGImage {
@ -158,11 +160,11 @@ Item {
}
}
}
}
StyledText {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
visible: root.pubkeyVisible
text: Utils.getElidedCompressedPk(pubkey)
@ -172,8 +174,7 @@ Item {
color: Style.current.secondaryText
}
Row {
width: 380
RowLayout {
Layout.alignment: Qt.AlignHCenter
visible: root.pubkeyVisibleWithCopy
StyledText {
@ -182,19 +183,16 @@ Item {
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Style.current.primaryTextFontSize
color: Style.current.secondaryText
width: 360
}
CopyToClipBoardButton {
id: copyBtn
width: 20
height: 20
Layout.preferredWidth: 20
Layout.preferredHeight: 20
color: Style.current.transparent
textToCopy: pubkey
store: root.store
}
}
EmojiHash {

View File

@ -164,6 +164,7 @@ Rectangle {
trustStatus: root.userTrustStatus
isContact: root.isContact
store: root.profileStore
isCurrentUser: root.isCurrentUser
displayNameVisible: false
displayNamePlusIconsVisible: true
@ -211,14 +212,13 @@ Rectangle {
subTitle: {
let user = ""
if (isCurrentUser) {
user = root.profileStore.ensName !== "" ? root.profileStore.ensName
: (root.profileStore.pubkey.substring(0, 5) + "..." + root.profileStore.pubkey.substring(root.profileStore.pubkey.length - 5))
user = root.profileStore.ensName !== "" ? root.profileStore.ensName : Utils.elideText(root.profileStore.pubkey, 5)
} else if (userIsEnsVerified) {
user = userEnsName
}
if (user === ""){
user = userPublicKey.substr(0, 4) + "..." + userPublicKey.substr(userPublicKey.length - 5)
user = Utils.elideText(userPublicKey, 5)
}
return Constants.userLinkPrefix + user;
}