fix(TransactionModal): fix values oferflowing

Fixes #1872
Elides those values and adds a tooltip to show them completely
This commit is contained in:
Jonathan Rainville 2021-04-20 12:10:04 -04:00 committed by Iuri Matias
parent 20f9f47028
commit ea802a95d7
3 changed files with 51 additions and 4 deletions

View File

@ -37,8 +37,8 @@ Item {
transactionDialog.closed()
}
ensUsername: username
width: 400
height: 400
width: 425
height: 425
}
}

View File

@ -3,6 +3,8 @@ import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13
import "../imports"
import "../shared"
import "../shared/status"
Item {
id: root
@ -67,7 +69,8 @@ Item {
if (!assetFound) {
return
}
txtAssetBalance.text = "Balance: " + (parseFloat(assetFound.value) === 0.0 ? "0" : Utils.stripTrailingZeros(assetFound.value)) + " " + assetFound.symbol
txtAssetBalance.text = qsTr("Balance: ") + (parseFloat(assetFound.value) === 0.0 ? "0" : Utils.stripTrailingZeros(assetFound.value))
txtAssetSymbol.text = " " + assetFound.symbol
}
StyledText {
@ -75,11 +78,39 @@ Item {
visible: root.assetFound !== undefined
anchors.bottom: select.top
anchors.bottomMargin: -18
anchors.right: parent.right
anchors.right: txtAssetSymbol.left
anchors.left: select.left
anchors.leftMargin: select.width / 2.5
color: !root.isValid ? Style.current.danger : Style.current.secondaryText
elide: Text.ElideRight
font.pixelSize: 13
horizontalAlignment: Text.AlignRight
height: 18
StatusToolTip {
enabled: txtAssetBalance.truncated
id: assetTooltip
text: txtAssetBalance.text
}
MouseArea {
enabled: txtAssetBalance.truncated
anchors.fill: parent
hoverEnabled: enabled
onEntered: assetTooltip.visible = true
onExited: assetTooltip.visible = false
}
}
StyledText {
id: txtAssetSymbol
visible: txtAssetBalance.visible
anchors.top: txtAssetBalance.top
anchors.right: parent.right
color: txtAssetBalance.color
font.pixelSize: 13
height: txtAssetBalance.height
}
Select {
id: select

View File

@ -391,13 +391,29 @@ Item {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
StyledText {
id: networkFeeText
font.pixelSize: 15
width: 75
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
StatusToolTip {
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
}
}
StyledText {
id: txtFeeSymbol