fix(ProfileDialogView): impossible to copy one's chat key

put a little label below the emoji hash with the elided compressed chat
key plus a copy button with a tooltip

Fixes #11665
This commit is contained in:
Lukáš Tinkl 2023-07-25 15:37:04 +02:00 committed by Lukáš Tinkl
parent 035f0b8122
commit 45784cf0cd
1 changed files with 26 additions and 0 deletions

View File

@ -327,6 +327,32 @@ Pane {
objectName: "ProfileDialog_userEmojiHash"
publicKey: root.publicKey
}
RowLayout {
StatusBaseText {
font.pixelSize: 12
color: Theme.palette.baseColor1
text: Utils.getElidedCompressedPk(root.publicKey)
}
StatusFlatButton {
size: StatusFlatButton.Size.Tiny
icon.name: "copy"
enabled: !d.timer.running
onClicked: {
copyKeyTooltip.text = qsTr("Copied")
root.profileStore.copyToClipboard(Utils.getCompressedPk(root.publicKey))
d.timer.setTimeout(function() {
copyKeyTooltip.text = qsTr("Copy Chat Key")
}, 1500);
}
StatusToolTip {
id: copyKeyTooltip
text: qsTr("Copy Chat Key")
visible: parent.hovered || d.timer.running
}
}
}
}
Loader {