From 234af3283e7b5a9c82acb8ce3b996d27f91c783a Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Mon, 24 Jan 2022 12:41:55 +0100 Subject: [PATCH] fix(@wallet): receive modal fixes #4534 --- .../AppLayouts/Wallet/popups/ReceiveModal.qml | 6 +++- ui/app/AppLayouts/Wallet/stores/RootStore.qml | 4 +-- ui/imports/shared/controls/Input.qml | 31 +++++++++---------- ui/imports/shared/stores/RootStore.qml | 4 +-- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/ui/app/AppLayouts/Wallet/popups/ReceiveModal.qml b/ui/app/AppLayouts/Wallet/popups/ReceiveModal.qml index ab6b72d984..b0b74c8dbe 100644 --- a/ui/app/AppLayouts/Wallet/popups/ReceiveModal.qml +++ b/ui/app/AppLayouts/Wallet/popups/ReceiveModal.qml @@ -64,11 +64,15 @@ ModalPopup { } Input { - id: txtWalletAddress + id: txtWalletAddress //% "Wallet address" label: qsTrId("wallet-address") anchors.top: accountSelector.bottom anchors.topMargin: Style.current.padding + anchors.left: parent.left + anchors.leftMargin: Style.current.padding + anchors.right: parent.right + anchors.rightMargin: Style.current.padding copyToClipboard: true textField.readOnly: true customHeight: 56 diff --git a/ui/app/AppLayouts/Wallet/stores/RootStore.qml b/ui/app/AppLayouts/Wallet/stores/RootStore.qml index b46685f6b6..fffb244e45 100644 --- a/ui/app/AppLayouts/Wallet/stores/RootStore.qml +++ b/ui/app/AppLayouts/Wallet/stores/RootStore.qml @@ -138,9 +138,7 @@ QtObject { } function getQrCode(address) { - // TODO: Move to transaction root module and not wallet - // Not Refactored Yet -// return profileModel.qrCode(address) + return globalUtils.qrCode(address) } function hex2Dec(value) { diff --git a/ui/imports/shared/controls/Input.qml b/ui/imports/shared/controls/Input.qml index af5681966f..09216d288a 100644 --- a/ui/imports/shared/controls/Input.qml +++ b/ui/imports/shared/controls/Input.qml @@ -8,6 +8,7 @@ import utils 1.0 import "../panels" import "../controls" +import "../stores" Item { id: inputBox @@ -88,7 +89,7 @@ Item { anchors.bottom: parent.bottom anchors.bottomMargin: 0 anchors.right: clipboardButtonLoader.active ? clipboardButtonLoader.left : parent.right - anchors.rightMargin: parent.rightMargin + anchors.rightMargin: clipboardButtonLoader.active ? Style.current.padding : parent.rightMargin anchors.left: parent.left anchors.leftMargin: 0 leftPadding: inputBox.hasIcon ? iconWidth + 20 : Style.current.padding @@ -144,7 +145,7 @@ Item { active: inputBox.copyToClipboard || inputBox.pasteFromClipboard anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - anchors.rightMargin: 8 + anchors.rightMargin: Style.current.padding sourceComponent: Component { Item { width: copyBtn.width @@ -172,23 +173,19 @@ Item { qsTrId("paste") } - height: 28 - font.pixelSize: 12 - size: StatusBaseButton.Size.Small onClicked: { - // Not Refactored Yet -// if (inputBox.copyToClipboard) { -// chatsModel.copyToClipboard(inputBox.textToCopy ? inputBox.textToCopy : inputValue.text) -// } else { -// if (inputValue.canPaste) { -// inputValue.paste() -// } -// } + if (inputBox.copyToClipboard) { + RootStore.copyToClipboard(inputBox.textToCopy ? inputBox.textToCopy : inputValue.text) + } else { + if (inputValue.canPaste) { + inputValue.paste() + } + } -// copyBtn.copied = true -// timer.setTimeout(function() { -// copyBtn.copied = false -// }, 2000); + copyBtn.copied = true + timer.setTimeout(function() { + copyBtn.copied = false + }, 2000); } } } diff --git a/ui/imports/shared/stores/RootStore.qml b/ui/imports/shared/stores/RootStore.qml index 172f2f7fbb..e5e409c6fd 100644 --- a/ui/imports/shared/stores/RootStore.qml +++ b/ui/imports/shared/stores/RootStore.qml @@ -69,8 +69,8 @@ QtObject { // return walletModelInst.transactionsView.transferTokens(from, to, address, amount, gasLimit, gasPrice, tipLimit, overallLimit, password, uuid); } - function copyToClipboard(textToCopy) { -// chatsModelInst.copyToClipboard(textToCopy) + function copyToClipboard(text) { + globalUtils.copyToClipboard(text) } property var gifColumnA: chatSectionChatContentInputArea.gifColumnA