mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-01 17:27:53 +00:00
fix(CommunityTransfer): fix private key display to match design
Fixes #2419 Makes it so the private key is elided by default so you can see it all from the get-go. If you focus the field, the key will "unfurl" and you can copy it manually. Otherwise. the Copy button will always copy the whole key
This commit is contained in:
parent
22398284e9
commit
33a77ab761
@ -22,10 +22,21 @@ ModalPopup {
|
||||
anchors.fill: parent
|
||||
|
||||
Input {
|
||||
property string elidedPkey: popup.privateKey.substring(0, 15) + "..." + popup.privateKey.substring(popup.privateKey.length - 16)
|
||||
|
||||
id: pKeyInput
|
||||
label: qsTr("Community private key")
|
||||
text: popup.privateKey
|
||||
copyToClipboard: popup.privateKey
|
||||
text: elidedPkey
|
||||
textField.onFocusChanged: {
|
||||
if (textField.focus) {
|
||||
pKeyInput.text = popup.privateKey
|
||||
} else {
|
||||
pKeyInput.text = elidedPkey
|
||||
}
|
||||
}
|
||||
|
||||
copyToClipboard: true
|
||||
textToCopy: popup.privateKey
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
@ -19,6 +19,7 @@ Item {
|
||||
property int iconHeight: 24
|
||||
property int iconWidth: 24
|
||||
property bool copyToClipboard: false
|
||||
property string textToCopy
|
||||
property bool pasteFromClipboard: false
|
||||
property bool readOnly: false
|
||||
|
||||
@ -150,7 +151,7 @@ Item {
|
||||
showBorder: true
|
||||
onClicked: {
|
||||
if (inputBox.copyToClipboard) {
|
||||
chatsModel.copyToClipboard(inputValue.text)
|
||||
chatsModel.copyToClipboard(inputBox.textToCopy ? inputBox.textToCopy : inputValue.text)
|
||||
} else {
|
||||
if (inputValue.canPaste) {
|
||||
inputValue.paste()
|
||||
|
Loading…
x
Reference in New Issue
Block a user