Browse Source

add fiat to balance summary

patch-4
Sander van Grieken 3 years ago
parent
commit
300e5e2168
  1. 73
      electrum/gui/qml/components/BalanceSummary.qml

73
electrum/gui/qml/components/BalanceSummary.qml

@ -10,10 +10,16 @@ Frame {
property string formattedBalance property string formattedBalance
property string formattedUnconfirmed property string formattedUnconfirmed
property string formattedBalanceFiat
property string formattedUnconfirmedFiat
function setBalances() { function setBalances() {
root.formattedBalance = Config.formatSats(Daemon.currentWallet.confirmedBalance, true) root.formattedBalance = Config.formatSats(Daemon.currentWallet.confirmedBalance)
root.formattedUnconfirmed = Config.formatSats(Daemon.currentWallet.unconfirmedBalance, true) root.formattedUnconfirmed = Config.formatSats(Daemon.currentWallet.unconfirmedBalance)
if (Daemon.fx.enabled) {
root.formattedBalanceFiat = Daemon.fx.fiatValue(Daemon.currentWallet.confirmedBalance.toString(), false)
root.formattedUnconfirmedFiat = Daemon.fx.fiatValue(Daemon.currentWallet.unconfirmedBalance.toString(), false)
}
} }
GridLayout { GridLayout {
@ -24,24 +30,67 @@ Frame {
font.pixelSize: constants.fontSizeLarge font.pixelSize: constants.fontSizeLarge
text: qsTr('Balance: ') text: qsTr('Balance: ')
} }
Label { RowLayout {
font.pixelSize: constants.fontSizeLarge Label {
color: Material.accentColor font.pixelSize: constants.fontSizeLarge
text: formattedBalance font.family: FixedFont
text: formattedBalance
}
Label {
font.pixelSize: constants.fontSizeMedium
color: Material.accentColor
text: Config.baseUnit
}
Label {
font.pixelSize: constants.fontSizeMedium
text: Daemon.fx.enabled
? '(' + root.formattedBalanceFiat + ' ' + Daemon.fx.fiatCurrency + ')'
: ''
}
} }
Label { Label {
text: qsTr('Confirmed: ') text: qsTr('Confirmed: ')
font.pixelSize: constants.fontSizeSmall
} }
Label { RowLayout {
color: Material.accentColor Label {
text: formattedBalance font.pixelSize: constants.fontSizeSmall
font.family: FixedFont
text: formattedBalance
}
Label {
font.pixelSize: constants.fontSizeSmall
color: Material.accentColor
text: Config.baseUnit
}
Label {
font.pixelSize: constants.fontSizeSmall
text: Daemon.fx.enabled
? '(' + root.formattedBalanceFiat + ' ' + Daemon.fx.fiatCurrency + ')'
: ''
}
} }
Label { Label {
font.pixelSize: constants.fontSizeSmall
text: qsTr('Unconfirmed: ') text: qsTr('Unconfirmed: ')
} }
Label { RowLayout {
color: Material.accentColor Label {
text: formattedUnconfirmed font.pixelSize: constants.fontSizeSmall
font.family: FixedFont
text: formattedUnconfirmed
}
Label {
font.pixelSize: constants.fontSizeSmall
color: Material.accentColor
text: Config.baseUnit
}
Label {
font.pixelSize: constants.fontSizeSmall
text: Daemon.fx.enabled
? '(' + root.formattedUnconfirmedFiat + ' ' + Daemon.fx.fiatCurrency + ')'
: ''
}
} }
} }

Loading…
Cancel
Save