diff --git a/ui/app/AppLayouts/Browser/popups/BrowserWalletMenu.qml b/ui/app/AppLayouts/Browser/popups/BrowserWalletMenu.qml index a0a39bdce5..96d0c6c71b 100644 --- a/ui/app/AppLayouts/Browser/popups/BrowserWalletMenu.qml +++ b/ui/app/AppLayouts/Browser/popups/BrowserWalletMenu.qml @@ -155,7 +155,7 @@ Popup { anchors.topMargin: Style.current.padding color: Style.current.transparent textToCopy: accountSelector.selectedAccount.address - store: RootStore + onCopyClicked: RootStore.copyToClipboard(textToCopy) } StatusFlatRoundButton { diff --git a/ui/app/AppLayouts/Wallet/controls/SavedAddressesDelegate.qml b/ui/app/AppLayouts/Wallet/controls/SavedAddressesDelegate.qml index 0520b18411..7d1cdc5069 100644 --- a/ui/app/AppLayouts/Wallet/controls/SavedAddressesDelegate.qml +++ b/ui/app/AppLayouts/Wallet/controls/SavedAddressesDelegate.qml @@ -51,8 +51,8 @@ StatusListItem { id: copyButton type: StatusRoundButton.Type.Tertiary icon.color: root.showButtons ? Theme.palette.directColor1 : Theme.palette.baseColor1 - store: root.store textToCopy: root.address + onCopyClicked: root.store.copyToClipboard(textToCopy) }, StatusRoundButton { objectName: "savedAddressView_Delegate_favouriteButton" diff --git a/ui/app/AppLayouts/Wallet/popups/ReceiveModal.qml b/ui/app/AppLayouts/Wallet/popups/ReceiveModal.qml index d1a96a4198..554bb409a9 100644 --- a/ui/app/AppLayouts/Wallet/popups/ReceiveModal.qml +++ b/ui/app/AppLayouts/Wallet/popups/ReceiveModal.qml @@ -238,8 +238,8 @@ StatusModal { spacing: 5 CopyToClipBoardButton { id: copyToClipBoard - store: RootStore textToCopy: txtWalletAddress.text + onCopyClicked: RootStore.copyToClipboard(textToCopy) } StatusBaseText { anchors.horizontalCenter: parent.horizontalCenter diff --git a/ui/app/AppLayouts/Wallet/views/TransactionDetailView.qml b/ui/app/AppLayouts/Wallet/views/TransactionDetailView.qml index 99c2ba7fe8..8c05b9f745 100644 --- a/ui/app/AppLayouts/Wallet/views/TransactionDetailView.qml +++ b/ui/app/AppLayouts/Wallet/views/TransactionDetailView.qml @@ -116,30 +116,12 @@ Item { expanded: true } - StatusListItem { - id: data - width: parent.width - anchors.horizontalCenter: parent.horizontalCenter - - color: "transparent" - border.width: 1 - border.color: Theme.palette.directColor8 - - statusListItemTitle.color: Theme.palette.baseColor1 - - title: qsTr("Data" ) - subTitle: root.isTransactionValid ? root.transaction.input : "" - components: [ - CopyToClipBoardButton { - icon.width: 15 - icon.height: 15 - type: StatusRoundButton.Type.Tertiary - color: "transparent" - icon.color: data.showButtons ? Theme.palette.directColor1 : Theme.palette.baseColor1 - store: RootStore - textToCopy: data.subTitle - } - ] + InformationTile { + maxWidth: parent.width + primaryText: qsTr("Data") + secondaryText: root.isTransactionValid ? root.transaction.input : "" + copy: true + onCopyClicked: RootStore.copyToClipboard(textToCopy) } } } diff --git a/ui/imports/shared/controls/CopyToClipBoardButton.qml b/ui/imports/shared/controls/CopyToClipBoardButton.qml index 7c1d818f18..dcf5db0cdf 100644 --- a/ui/imports/shared/controls/CopyToClipBoardButton.qml +++ b/ui/imports/shared/controls/CopyToClipBoardButton.qml @@ -10,7 +10,8 @@ StatusRoundButton { property var onClick: function() {} property string textToCopy: "" property bool tooltipUnder: false - property var store + + signal copyClicked(string textToCopy) icon.name: "copy" @@ -21,7 +22,7 @@ StatusRoundButton { } onClicked: { if (textToCopy) { - store.copyToClipboard(textToCopy) + copyToClipboardButton.copyClicked(textToCopy) } onClick() } diff --git a/ui/imports/shared/controls/InformationTile.qml b/ui/imports/shared/controls/InformationTile.qml index a8c9125ef2..73ce539ce1 100644 --- a/ui/imports/shared/controls/InformationTile.qml +++ b/ui/imports/shared/controls/InformationTile.qml @@ -17,8 +17,11 @@ Rectangle { property alias tagsModel: tags.model property alias tagsDelegate: tags.delegate property int maxWidth: 0 + property bool copy: false - implicitHeight: 52 + signal copyClicked(string textToCopy) + + implicitHeight: root.copy ? 75 : 52 implicitWidth: layout.width + Style.current.xlPadding radius: Style.current.radius border.width: 1 @@ -37,13 +40,26 @@ Rectangle { visible: text elide: Text.ElideRight } - StatusBaseText { - id: secondaryText - Layout.maximumWidth: root.maxWidth - Style.current.xlPadding - font.pixelSize: 15 - color: Theme.palette.directColor1 - visible: text - elide: Text.ElideRight + RowLayout { + width: 100 + StatusBaseText { + id: secondaryText + Layout.maximumWidth: root.maxWidth - Style.current.xlPadding - (root.copy ? 50 : 0) + font.pixelSize: 15 + color: Theme.palette.directColor1 + visible: text + elide: Text.ElideRight + } + CopyToClipBoardButton { + visible: root.copy + icon.width: 15 + icon.height: 15 + type: StatusRoundButton.Type.Tertiary + color: "transparent" + icon.color: Theme.palette.directColor1 + textToCopy: secondaryText.text + onCopyClicked: root.copyClicked(textToCopy) + } } ScrollView { Layout.preferredHeight: 24 diff --git a/ui/imports/shared/controls/chat/ProfileHeader.qml b/ui/imports/shared/controls/chat/ProfileHeader.qml index 8daa7827e5..d130895ab7 100644 --- a/ui/imports/shared/controls/chat/ProfileHeader.qml +++ b/ui/imports/shared/controls/chat/ProfileHeader.qml @@ -234,7 +234,7 @@ Item { Layout.preferredHeight: 20 color: Style.current.transparent textToCopy: pubkey - store: root.store + onCopyClicked: root.store.copyToClipboard(textToCopy) } } diff --git a/ui/imports/shared/status/StatusExpandableAddress.qml b/ui/imports/shared/status/StatusExpandableAddress.qml index 4c7ffabf6a..3fdb57964d 100644 --- a/ui/imports/shared/status/StatusExpandableAddress.qml +++ b/ui/imports/shared/status/StatusExpandableAddress.qml @@ -83,7 +83,7 @@ Item { anchors.verticalCenter: parent.verticalCenter color: Style.current.transparent textToCopy: root.address - store: root.store + onCopyClicked: root.store.copyToClipboard(textToCopy) MouseArea { anchors.fill: parent propagateComposedEvents: true diff --git a/ui/imports/shared/status/StatusSectionDescItem.qml b/ui/imports/shared/status/StatusSectionDescItem.qml index 61ea8ea117..71537eee0f 100644 --- a/ui/imports/shared/status/StatusSectionDescItem.qml +++ b/ui/imports/shared/status/StatusSectionDescItem.qml @@ -47,7 +47,7 @@ Item { anchors.left: parent.right anchors.leftMargin: Style.current.smallPadding color: Style.current.transparent - store: root.store + onCopyClicked: root.store.copyToClipboard(textToCopy) } } }