2020-08-13 08:24:51 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import QtGraphicalEffects 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2022-07-13 12:29:38 +00:00
|
|
|
import StatusQ.Core 0.1
|
2021-10-14 20:30:51 +00:00
|
|
|
import StatusQ.Controls 0.1 as StatusQ
|
2022-04-13 13:39:19 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2021-10-14 20:30:51 +00:00
|
|
|
|
2021-10-14 13:45:08 +00:00
|
|
|
import "../status"
|
|
|
|
import "../panels"
|
|
|
|
import "../controls"
|
|
|
|
import "../popups"
|
2022-04-13 13:39:19 +00:00
|
|
|
import shared.controls.chat 1.0
|
2020-08-13 08:24:51 +00:00
|
|
|
|
2021-10-20 22:47:23 +00:00
|
|
|
|
2020-08-13 08:24:51 +00:00
|
|
|
Item {
|
|
|
|
id: root
|
2020-08-20 04:45:29 +00:00
|
|
|
property var fromAccount
|
|
|
|
property var toAccount
|
|
|
|
property var asset
|
|
|
|
property var amount
|
2020-12-09 16:01:51 +00:00
|
|
|
property string trxData: ""
|
2020-08-13 08:24:51 +00:00
|
|
|
property string currency: "USD"
|
2020-08-20 04:45:29 +00:00
|
|
|
property var gas
|
2020-08-21 07:56:42 +00:00
|
|
|
height: content.height
|
2020-10-07 02:47:21 +00:00
|
|
|
signal fromClicked
|
|
|
|
signal gasClicked
|
2022-02-09 09:43:23 +00:00
|
|
|
// Creates a mouse area around the "from account". When clicked, triggers
|
2020-10-16 07:37:07 +00:00
|
|
|
// the "fromClicked" signal
|
|
|
|
property bool isFromEditable: false
|
2022-02-09 09:43:23 +00:00
|
|
|
// Creates a mouse area around the "network fee". When clicked, triggers
|
2020-10-16 07:37:07 +00:00
|
|
|
// the "gasClicked" signal
|
|
|
|
property bool isGasEditable: false
|
2020-10-22 15:29:05 +00:00
|
|
|
property bool isValid: toValid && fromValid && gasValid
|
2020-10-22 12:06:35 +00:00
|
|
|
property bool fromValid: true
|
2020-10-22 15:29:05 +00:00
|
|
|
property bool toValid: true
|
|
|
|
property bool toWarn: false
|
2020-10-22 12:06:35 +00:00
|
|
|
property bool gasValid: true
|
2020-08-20 04:45:29 +00:00
|
|
|
|
2020-08-13 08:24:51 +00:00
|
|
|
Column {
|
2020-08-21 07:56:42 +00:00
|
|
|
id: content
|
2020-08-13 08:24:51 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
LabelValueRow {
|
|
|
|
id: itmFrom
|
2022-04-04 11:26:30 +00:00
|
|
|
label: qsTr("From")
|
2020-08-13 08:24:51 +00:00
|
|
|
value: Item {
|
2020-10-16 07:37:07 +00:00
|
|
|
id: itmFromValue
|
2020-08-13 08:24:51 +00:00
|
|
|
anchors.fill: parent
|
2020-10-22 12:06:35 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2020-10-16 07:37:07 +00:00
|
|
|
function needsRightPadding() {
|
2020-10-22 12:06:35 +00:00
|
|
|
return !root.fromValid || root.isFromEditable
|
2020-08-13 08:24:51 +00:00
|
|
|
}
|
2020-10-16 07:37:07 +00:00
|
|
|
Row {
|
|
|
|
spacing: Style.current.halfPadding
|
|
|
|
rightPadding: itmFromValue.needsRightPadding() ? Style.current.halfPadding : 0
|
2020-10-07 02:47:21 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2020-10-16 07:37:07 +00:00
|
|
|
|
|
|
|
StyledText {
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
|
|
|
text: root.fromAccount ? root.fromAccount.name : ""
|
|
|
|
elide: Text.ElideRight
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
SVGImage {
|
|
|
|
id: imgFromWallet
|
|
|
|
sourceSize.height: 18
|
|
|
|
sourceSize.width: 18
|
2020-10-16 13:21:57 +00:00
|
|
|
visible: !!root.fromAccount ? root.fromAccount.type === RecipientSelector.Type.Account : true
|
2020-10-16 07:37:07 +00:00
|
|
|
horizontalAlignment: Image.AlignLeft
|
|
|
|
width: itmFromValue.needsRightPadding() ? (Style.current.halfPadding + sourceSize.width) : undefined // adding width to add addl spacing to image
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2021-10-05 20:50:22 +00:00
|
|
|
source: Style.svg("walletIcon")
|
2020-10-16 07:37:07 +00:00
|
|
|
ColorOverlay {
|
2020-10-16 13:21:57 +00:00
|
|
|
visible: parent.visible
|
2020-10-16 07:37:07 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
source: parent
|
2021-11-04 18:55:21 +00:00
|
|
|
color: root.fromAccount && root.fromAccount.color ? root.fromAccount.color : Style.current.blue
|
2020-10-16 07:37:07 +00:00
|
|
|
}
|
|
|
|
}
|
2020-10-22 12:06:35 +00:00
|
|
|
SVGImage {
|
|
|
|
id: fromInvalid
|
2020-10-16 07:37:07 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2020-10-22 12:06:35 +00:00
|
|
|
width: 13.33
|
|
|
|
height: 13.33
|
|
|
|
sourceSize.height: height * 2
|
|
|
|
sourceSize.width: width * 2
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2021-10-05 20:50:22 +00:00
|
|
|
source: Style.svg("exclamation_outline")
|
2020-10-22 12:06:35 +00:00
|
|
|
visible: !root.fromValid
|
2020-10-16 07:37:07 +00:00
|
|
|
}
|
|
|
|
SVGImage {
|
|
|
|
id: fromArrow
|
|
|
|
width: 13
|
2021-03-03 13:52:51 +00:00
|
|
|
height: 7
|
2020-10-16 07:37:07 +00:00
|
|
|
visible: root.isFromEditable
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2021-10-05 20:50:22 +00:00
|
|
|
source: Style.svg("caret")
|
2020-10-16 07:37:07 +00:00
|
|
|
rotation: 270
|
|
|
|
ColorOverlay {
|
|
|
|
anchors.fill: parent
|
|
|
|
visible: parent.visible
|
|
|
|
source: parent
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
}
|
2020-10-07 02:47:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
visible: fromArrow.visible
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: root.fromClicked()
|
2020-08-13 08:24:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LabelValueRow {
|
|
|
|
id: itmTo
|
2020-10-22 15:29:05 +00:00
|
|
|
function needsRightPadding() {
|
|
|
|
return !root.toValid || root.toWarn
|
|
|
|
}
|
2022-04-04 11:26:30 +00:00
|
|
|
label: qsTr("Recipient")
|
2020-08-13 08:24:51 +00:00
|
|
|
states: [
|
|
|
|
State {
|
|
|
|
name: "Address"
|
2020-08-20 04:45:29 +00:00
|
|
|
when: !!root.toAccount && root.toAccount.type === RecipientSelector.Type.Address
|
2020-08-13 08:24:51 +00:00
|
|
|
PropertyChanges {
|
|
|
|
target: txtToPrimary
|
2022-04-04 11:26:30 +00:00
|
|
|
text: (!!root.toAccount && root.toAccount.address) ? root.toAccount.address : qsTr("Unknown")
|
2020-08-13 08:24:51 +00:00
|
|
|
elide: Text.ElideMiddle
|
|
|
|
anchors.leftMargin: 190
|
2020-09-01 03:49:05 +00:00
|
|
|
anchors.right: parent.right
|
2020-08-13 08:24:51 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: txtToSecondary
|
|
|
|
width: 0
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: "Contact"
|
2020-08-20 04:45:29 +00:00
|
|
|
when: !!root.toAccount && root.toAccount.type === RecipientSelector.Type.Contact && !!root.toAccount.address
|
2020-08-13 08:24:51 +00:00
|
|
|
PropertyChanges {
|
|
|
|
target: metSecondary
|
|
|
|
text: root.toAccount.ensVerified ? root.toAccount.alias : root.toAccount.address
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: txtToSecondary
|
2020-09-01 03:49:05 +00:00
|
|
|
anchors.right: idtToContact.left
|
|
|
|
anchors.rightMargin: Style.current.halfPadding
|
2020-10-20 11:24:49 +00:00
|
|
|
width: txtToSecondary.visible ? metSecondary.elidedWidth : 0
|
2020-08-13 08:24:51 +00:00
|
|
|
text: metSecondary.elidedText
|
2020-10-20 11:24:49 +00:00
|
|
|
visible: root.toAccount.address !== Constants.zeroAddress
|
2020-08-13 08:24:51 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: idtToContact
|
|
|
|
visible: true
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: txtToPrimary
|
2022-11-08 11:37:25 +00:00
|
|
|
text: root.toAccount.name
|
2020-08-13 08:24:51 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: "Account"
|
2020-08-20 04:45:29 +00:00
|
|
|
when: !!root.toAccount && root.toAccount.type === RecipientSelector.Type.Account && !!root.toAccount.address
|
2020-08-13 08:24:51 +00:00
|
|
|
PropertyChanges {
|
|
|
|
target: metSecondary
|
|
|
|
text: root.toAccount.address
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: txtToSecondary
|
2020-09-01 03:49:05 +00:00
|
|
|
anchors.right: imgToWallet.left
|
|
|
|
anchors.rightMargin: Style.current.halfPadding
|
2020-08-13 08:24:51 +00:00
|
|
|
text: metSecondary.elidedText
|
|
|
|
width: metSecondary.elidedWidth
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: imgToWallet
|
|
|
|
visible: true
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: ovlToWallet
|
|
|
|
visible: true
|
2021-11-04 18:55:21 +00:00
|
|
|
color: root.toAccount.color
|
2020-08-13 08:24:51 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: txtToPrimary
|
|
|
|
text: root.toAccount.name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
2020-10-16 13:21:57 +00:00
|
|
|
StyledText {
|
|
|
|
id: txtToPrimary
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
|
|
|
anchors.left: parent.left
|
2020-10-20 11:24:49 +00:00
|
|
|
anchors.right: txtToSeparator.visible ? txtToSeparator.left : idtToContact.left
|
|
|
|
anchors.rightMargin: txtToSeparator.visible ? 0 : Style.current.halfPadding
|
2020-10-16 13:21:57 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
elide: Text.ElideRight
|
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
id: txtToSeparator
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
|
|
|
text: " • "
|
|
|
|
visible: txtToSecondary.visible && txtToSecondary.width > 0
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
anchors.right: txtToSecondary.left
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
id: txtToSecondary
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
TextMetrics {
|
|
|
|
id: metSecondary
|
|
|
|
elideWidth: 102
|
|
|
|
elide: Text.ElideMiddle
|
|
|
|
}
|
|
|
|
SVGImage {
|
|
|
|
id: imgToWallet
|
|
|
|
visible: false
|
|
|
|
sourceSize.height: 18
|
|
|
|
sourceSize.width: 18
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2021-10-05 20:50:22 +00:00
|
|
|
source: Style.svg("walletIcon")
|
2020-10-16 13:21:57 +00:00
|
|
|
}
|
|
|
|
ColorOverlay {
|
|
|
|
id: ovlToWallet
|
|
|
|
anchors.fill: imgToWallet
|
|
|
|
visible: false
|
|
|
|
source: imgToWallet
|
|
|
|
}
|
2022-04-13 13:39:19 +00:00
|
|
|
UserImage {
|
2020-10-16 13:21:57 +00:00
|
|
|
id: idtToContact
|
|
|
|
visible: false
|
2020-10-22 15:29:05 +00:00
|
|
|
anchors.right: toInvalid.visible ? toInvalid.left : parent.right
|
|
|
|
anchors.rightMargin: toInvalid.visible ? Style.current.halfPadding : 0
|
2020-10-16 13:21:57 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2022-04-13 13:39:19 +00:00
|
|
|
name: root.toAccount.name
|
|
|
|
pubkey: root.toAccount.pubKey
|
|
|
|
image: root.toAccount.icon
|
2022-12-01 10:24:25 +00:00
|
|
|
ensVerified: root.toAccount.ensVerified
|
2020-08-13 08:24:51 +00:00
|
|
|
}
|
2020-10-22 15:29:05 +00:00
|
|
|
SVGImage {
|
|
|
|
id: toInvalid
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.right: parent.right
|
|
|
|
width: 13.33
|
|
|
|
height: 13.33
|
|
|
|
sourceSize.height: height * 2
|
|
|
|
sourceSize.width: width * 2
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2021-10-05 20:50:22 +00:00
|
|
|
source: Style.svg("exclamation_outline")
|
2020-10-22 15:29:05 +00:00
|
|
|
visible: !root.toValid || root.toWarn
|
|
|
|
}
|
2020-08-13 08:24:51 +00:00
|
|
|
}
|
|
|
|
LabelValueRow {
|
|
|
|
id: itmAsset
|
2022-04-04 11:26:30 +00:00
|
|
|
label: qsTr("Asset")
|
2020-08-13 08:24:51 +00:00
|
|
|
value: Item {
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
|
|
|
text: (root.asset && root.asset.name) ? root.asset.name : ""
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: txtAssetSymbol.left
|
2020-08-20 04:45:29 +00:00
|
|
|
anchors.rightMargin: Style.current.halfPadding
|
2020-08-13 08:24:51 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
id: txtAssetSymbol
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
|
|
|
text: (root.asset && root.asset.symbol) ? root.asset.symbol : ""
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
anchors.right: imgAsset.left
|
2020-08-20 04:45:29 +00:00
|
|
|
anchors.rightMargin: Style.current.halfPadding
|
2020-08-13 08:24:51 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
Image {
|
|
|
|
id: imgAsset
|
|
|
|
sourceSize.height: 32
|
|
|
|
sourceSize.width: 32
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2021-09-28 15:04:06 +00:00
|
|
|
source: Style.png("tokens/" + ((root.asset && root.asset.symbol) ? root.asset.symbol : "ETH"))
|
2020-08-13 08:24:51 +00:00
|
|
|
onStatusChanged: {
|
|
|
|
if (status == Image.Error) {
|
2021-09-28 15:04:06 +00:00
|
|
|
source = Style.png("tokens/DEFAULT-TOKEN@3x")
|
2020-08-13 08:24:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LabelValueRow {
|
|
|
|
id: itmAmount
|
2022-04-04 11:26:30 +00:00
|
|
|
label: qsTr("Amount")
|
2020-08-13 08:24:51 +00:00
|
|
|
value: Item {
|
|
|
|
id: amountRoot
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
2020-08-20 04:45:29 +00:00
|
|
|
text: (root.amount && root.amount.value) ? Utils.stripTrailingZeros(root.amount.value) : ""
|
2020-08-13 08:24:51 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: txtAmountSymbol.left
|
|
|
|
anchors.rightMargin: 5
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
elide: Text.ElideRight
|
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
id: txtAmountSymbol
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
|
|
|
text: ((root.asset && root.asset.symbol) ? root.asset.symbol : "") + " •"
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
anchors.right: txtAmountFiat.left
|
|
|
|
anchors.rightMargin: 5
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
id: txtAmountFiat
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
2020-08-20 04:45:29 +00:00
|
|
|
text: "~" + (root.amount && root.amount.fiatValue ? root.amount.fiatValue : "0.00")
|
2020-08-13 08:24:51 +00:00
|
|
|
anchors.right: txtAmountCurrency.left
|
|
|
|
anchors.rightMargin: 5
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
id: txtAmountCurrency
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
2023-03-27 07:52:12 +00:00
|
|
|
text: root.currency
|
2020-08-13 08:24:51 +00:00
|
|
|
color: Style.current.secondaryText
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LabelValueRow {
|
|
|
|
id: itmNetworkFee
|
2022-04-04 11:26:30 +00:00
|
|
|
label: qsTr("Network fee")
|
2020-10-07 02:47:21 +00:00
|
|
|
visible: !!root.gas
|
2020-08-13 08:24:51 +00:00
|
|
|
value: Item {
|
|
|
|
id: networkFeeRoot
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2020-10-22 12:06:35 +00:00
|
|
|
function needsRightPadding() {
|
|
|
|
return !root.gasValid || root.isGasEditable
|
2020-08-13 08:24:51 +00:00
|
|
|
}
|
2020-10-22 12:06:35 +00:00
|
|
|
Row {
|
|
|
|
spacing: Style.current.halfPadding
|
|
|
|
rightPadding: networkFeeRoot.needsRightPadding() ? Style.current.halfPadding : 0
|
2020-10-07 02:47:21 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2020-10-22 12:06:35 +00:00
|
|
|
StyledText {
|
2021-04-20 16:10:04 +00:00
|
|
|
id: networkFeeText
|
2020-10-22 12:06:35 +00:00
|
|
|
font.pixelSize: 15
|
2021-04-20 16:10:04 +00:00
|
|
|
width: 75
|
2020-10-22 12:06:35 +00:00
|
|
|
height: 22
|
|
|
|
text: (root.gas && root.gas.value) ? Utils.stripTrailingZeros(root.gas.value) : ""
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
elide: Text.ElideRight
|
2021-04-20 16:10:04 +00:00
|
|
|
|
2021-10-14 20:30:51 +00:00
|
|
|
StatusQ.StatusToolTip {
|
2021-04-20 16:10:04 +00:00
|
|
|
enabled: networkFeeText.truncated
|
|
|
|
id: networkFeeTooltip
|
|
|
|
text: networkFeeText.text
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
enabled: networkFeeText.truncated
|
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: enabled
|
|
|
|
onEntered: networkFeeTooltip.visible = true
|
|
|
|
onExited: networkFeeTooltip.visible = false
|
|
|
|
}
|
2020-10-22 12:06:35 +00:00
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
id: txtFeeSymbol
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
|
|
|
text: ((root.gas && root.gas.symbol) ? root.gas.symbol : "") + " •"
|
2020-10-07 02:47:21 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-10-22 12:06:35 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
id: txtFeeFiat
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
|
|
|
text: "~" + ((root.gas && root.gas.fiatValue) ? root.gas.fiatValue : "0.00")
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
id: txtFeeCurrency
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
2023-03-27 07:52:12 +00:00
|
|
|
text: root.currency
|
2020-10-22 12:06:35 +00:00
|
|
|
color: Style.current.secondaryText
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
SVGImage {
|
|
|
|
id: gasInvalid
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
width: 13.33
|
|
|
|
height: 13.33
|
|
|
|
sourceSize.height: height * 2
|
|
|
|
sourceSize.width: width * 2
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2021-10-05 20:50:22 +00:00
|
|
|
source: Style.svg("exclamation_outline")
|
2020-10-22 12:06:35 +00:00
|
|
|
visible: !root.gasValid
|
|
|
|
}
|
|
|
|
SVGImage {
|
|
|
|
id: gasArrow
|
|
|
|
width: 13
|
2021-03-03 13:52:51 +00:00
|
|
|
height: 7
|
2020-10-22 12:06:35 +00:00
|
|
|
visible: root.isGasEditable
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2021-10-05 20:50:22 +00:00
|
|
|
source: Style.svg("caret")
|
2020-10-22 12:06:35 +00:00
|
|
|
rotation: 270
|
|
|
|
ColorOverlay {
|
|
|
|
anchors.fill: parent
|
|
|
|
visible: parent.visible
|
|
|
|
source: parent
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
}
|
2020-10-07 02:47:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
visible: gasArrow.visible
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: root.gasClicked()
|
|
|
|
}
|
2020-08-13 08:24:51 +00:00
|
|
|
}
|
|
|
|
}
|
2020-12-09 15:58:42 +00:00
|
|
|
LabelValueRow {
|
|
|
|
id: itmData
|
2022-04-04 11:26:30 +00:00
|
|
|
label: qsTr("Data")
|
2020-12-09 15:58:42 +00:00
|
|
|
visible: trxData !== "0x" && trxData !== ""
|
|
|
|
value: Item {
|
|
|
|
id: dataRoot
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
Row {
|
|
|
|
spacing: Style.current.halfPadding
|
|
|
|
rightPadding: 0
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
StyledText {
|
|
|
|
font.pixelSize: 15
|
|
|
|
height: 22
|
|
|
|
width: 200
|
|
|
|
text: trxData
|
|
|
|
elide: Text.ElideRight
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
SVGImage {
|
|
|
|
width: 13
|
2021-03-03 13:52:51 +00:00
|
|
|
height: 7
|
2020-12-09 15:58:42 +00:00
|
|
|
visible: true
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2021-10-05 20:50:22 +00:00
|
|
|
source: Style.svg("caret")
|
2020-12-09 15:58:42 +00:00
|
|
|
rotation: 270
|
|
|
|
ColorOverlay {
|
|
|
|
anchors.fill: parent
|
|
|
|
visible: parent.visible
|
|
|
|
source: parent
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-14 11:33:34 +00:00
|
|
|
// TODO: replace with StatusModal
|
2020-12-09 15:58:42 +00:00
|
|
|
ModalPopup {
|
|
|
|
id: dataPopup
|
2022-04-04 11:26:30 +00:00
|
|
|
title: qsTr("Data field")
|
2020-12-09 15:58:42 +00:00
|
|
|
height: 286
|
|
|
|
width: 400
|
|
|
|
Item {
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.leftMargin: 0
|
|
|
|
anchors.rightMargin: 0
|
2022-07-13 12:29:38 +00:00
|
|
|
StatusScrollView {
|
2020-12-09 15:58:42 +00:00
|
|
|
width: parent.width
|
|
|
|
height: 150
|
|
|
|
TextArea {
|
|
|
|
wrapMode: TextEdit.Wrap
|
|
|
|
readOnly: true
|
|
|
|
text: trxData
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: dataPopup.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-13 08:24:51 +00:00
|
|
|
}
|
|
|
|
}
|