fix(@wallet): trim tx data

This commit is contained in:
Anthony Laibe 2023-02-20 13:55:39 +01:00 committed by Anthony Laibe
parent abd1672e90
commit d9ed23b2d6
9 changed files with 39 additions and 40 deletions

View File

@ -155,7 +155,7 @@ Popup {
anchors.topMargin: Style.current.padding anchors.topMargin: Style.current.padding
color: Style.current.transparent color: Style.current.transparent
textToCopy: accountSelector.selectedAccount.address textToCopy: accountSelector.selectedAccount.address
store: RootStore onCopyClicked: RootStore.copyToClipboard(textToCopy)
} }
StatusFlatRoundButton { StatusFlatRoundButton {

View File

@ -51,8 +51,8 @@ StatusListItem {
id: copyButton id: copyButton
type: StatusRoundButton.Type.Tertiary type: StatusRoundButton.Type.Tertiary
icon.color: root.showButtons ? Theme.palette.directColor1 : Theme.palette.baseColor1 icon.color: root.showButtons ? Theme.palette.directColor1 : Theme.palette.baseColor1
store: root.store
textToCopy: root.address textToCopy: root.address
onCopyClicked: root.store.copyToClipboard(textToCopy)
}, },
StatusRoundButton { StatusRoundButton {
objectName: "savedAddressView_Delegate_favouriteButton" objectName: "savedAddressView_Delegate_favouriteButton"

View File

@ -238,8 +238,8 @@ StatusModal {
spacing: 5 spacing: 5
CopyToClipBoardButton { CopyToClipBoardButton {
id: copyToClipBoard id: copyToClipBoard
store: RootStore
textToCopy: txtWalletAddress.text textToCopy: txtWalletAddress.text
onCopyClicked: RootStore.copyToClipboard(textToCopy)
} }
StatusBaseText { StatusBaseText {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View File

@ -116,30 +116,12 @@ Item {
expanded: true expanded: true
} }
StatusListItem { InformationTile {
id: data maxWidth: parent.width
width: parent.width primaryText: qsTr("Data")
anchors.horizontalCenter: parent.horizontalCenter secondaryText: root.isTransactionValid ? root.transaction.input : ""
copy: true
color: "transparent" onCopyClicked: RootStore.copyToClipboard(textToCopy)
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
}
]
} }
} }
} }

View File

@ -10,7 +10,8 @@ StatusRoundButton {
property var onClick: function() {} property var onClick: function() {}
property string textToCopy: "" property string textToCopy: ""
property bool tooltipUnder: false property bool tooltipUnder: false
property var store
signal copyClicked(string textToCopy)
icon.name: "copy" icon.name: "copy"
@ -21,7 +22,7 @@ StatusRoundButton {
} }
onClicked: { onClicked: {
if (textToCopy) { if (textToCopy) {
store.copyToClipboard(textToCopy) copyToClipboardButton.copyClicked(textToCopy)
} }
onClick() onClick()
} }

View File

@ -17,8 +17,11 @@ Rectangle {
property alias tagsModel: tags.model property alias tagsModel: tags.model
property alias tagsDelegate: tags.delegate property alias tagsDelegate: tags.delegate
property int maxWidth: 0 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 implicitWidth: layout.width + Style.current.xlPadding
radius: Style.current.radius radius: Style.current.radius
border.width: 1 border.width: 1
@ -37,14 +40,27 @@ Rectangle {
visible: text visible: text
elide: Text.ElideRight elide: Text.ElideRight
} }
RowLayout {
width: 100
StatusBaseText { StatusBaseText {
id: secondaryText id: secondaryText
Layout.maximumWidth: root.maxWidth - Style.current.xlPadding Layout.maximumWidth: root.maxWidth - Style.current.xlPadding - (root.copy ? 50 : 0)
font.pixelSize: 15 font.pixelSize: 15
color: Theme.palette.directColor1 color: Theme.palette.directColor1
visible: text visible: text
elide: Text.ElideRight 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 { ScrollView {
Layout.preferredHeight: 24 Layout.preferredHeight: 24
Layout.maximumWidth: root.maxWidth - Style.current.xlPadding Layout.maximumWidth: root.maxWidth - Style.current.xlPadding

View File

@ -234,7 +234,7 @@ Item {
Layout.preferredHeight: 20 Layout.preferredHeight: 20
color: Style.current.transparent color: Style.current.transparent
textToCopy: pubkey textToCopy: pubkey
store: root.store onCopyClicked: root.store.copyToClipboard(textToCopy)
} }
} }

View File

@ -83,7 +83,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: Style.current.transparent color: Style.current.transparent
textToCopy: root.address textToCopy: root.address
store: root.store onCopyClicked: root.store.copyToClipboard(textToCopy)
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
propagateComposedEvents: true propagateComposedEvents: true

View File

@ -47,7 +47,7 @@ Item {
anchors.left: parent.right anchors.left: parent.right
anchors.leftMargin: Style.current.smallPadding anchors.leftMargin: Style.current.smallPadding
color: Style.current.transparent color: Style.current.transparent
store: root.store onCopyClicked: root.store.copyToClipboard(textToCopy)
} }
} }
} }