From 45784cf0cd046bf91774c1e83802b0f122aa3ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Tue, 25 Jul 2023 15:37:04 +0200 Subject: [PATCH] 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 --- ui/imports/shared/views/ProfileDialogView.qml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/ui/imports/shared/views/ProfileDialogView.qml b/ui/imports/shared/views/ProfileDialogView.qml index 5bb07b7c8d..fa91ebcb53 100644 --- a/ui/imports/shared/views/ProfileDialogView.qml +++ b/ui/imports/shared/views/ProfileDialogView.qml @@ -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 {