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
color: Style.current.transparent
textToCopy: accountSelector.selectedAccount.address
store: RootStore
onCopyClicked: RootStore.copyToClipboard(textToCopy)
}
StatusFlatRoundButton {

View File

@ -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"

View File

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

View File

@ -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)
}
}
}

View File

@ -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()
}

View File

@ -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

View File

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

View File

@ -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

View File

@ -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)
}
}
}