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
|
|
|
|
2021-10-14 20:30:51 +00:00
|
|
|
import StatusQ.Controls 0.1 as StatusQ
|
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"
|
2020-08-13 08:24:51 +00:00
|
|
|
|
2021-10-20 22:47:23 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
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
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "From"
|
|
|
|
label: qsTrId("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
|
|
|
|
}
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "Recipient"
|
|
|
|
label: qsTrId("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
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Unknown"
|
|
|
|
text: (!!root.toAccount && root.toAccount.address) ? root.toAccount.address : qsTrId("active-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
|
2022-02-09 00:04:49 +00:00
|
|
|
image.source: root.toAccount.identicon
|
2020-08-13 08:24:51 +00:00
|
|
|
visible: true
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: txtToPrimary
|
|
|
|
text: Utils.removeStatusEns(root.toAccount.name)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
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
|
|
|
|
}
|
2021-10-20 22:47:23 +00:00
|
|
|
StatusSmartIdenticon {
|
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
|
2021-10-20 22:47:23 +00:00
|
|
|
image.width: 32
|
|
|
|
image.height: 32
|
2022-02-09 00:04:49 +00:00
|
|
|
image.isIdenticon: true
|
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
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "Asset"
|
|
|
|
label: qsTrId("wallet-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
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "Amount"
|
|
|
|
label: qsTrId("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
|
|
|
|
text: root.currency.toUpperCase()
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LabelValueRow {
|
|
|
|
id: itmNetworkFee
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "Network fee"
|
|
|
|
label: qsTrId("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
|
|
|
|
text: root.currency.toUpperCase()
|
|
|
|
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
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Data"
|
|
|
|
label: qsTrId("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
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Data field"
|
|
|
|
title: qsTrId("data-field")
|
2020-12-09 15:58:42 +00:00
|
|
|
height: 286
|
|
|
|
width: 400
|
|
|
|
Item {
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.leftMargin: 0
|
|
|
|
anchors.rightMargin: 0
|
|
|
|
ScrollView {
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|