Browse Source

qml: BalanceSummary add lightning can send/receive amounts

master
Sander van Grieken 3 years ago
parent
commit
4b7472b13f
  1. 89
      electrum/gui/qml/components/controls/BalanceSummary.qml

89
electrum/gui/qml/components/controls/BalanceSummary.qml

@ -11,11 +11,19 @@ Item {
property string formattedTotalBalance
property string formattedTotalBalanceFiat
property string formattedLightningCanReceive
property string formattedLightningCanReceiveFiat
property string formattedLightningCanSend
property string formattedLightningCanSendFiat
function setBalances() {
root.formattedTotalBalance = Config.formatSats(Daemon.currentWallet.totalBalance)
root.formattedLightningCanReceive = Config.formatSats(Daemon.currentWallet.lightningCanReceive)
root.formattedLightningCanSend = Config.formatSats(Daemon.currentWallet.lightningCanSend)
if (Daemon.fx.enabled) {
root.formattedTotalBalanceFiat = Daemon.fx.fiatValue(Daemon.currentWallet.totalBalance, false)
root.formattedLightningCanReceiveFiat = Daemon.fx.fiatValue(Daemon.currentWallet.lightningCanReceive, false)
root.formattedLightningCanSendFiat = Daemon.fx.fiatValue(Daemon.currentWallet.lightningCanSend, false)
}
}
@ -60,6 +68,87 @@ Item {
color: constants.mutedForeground
text: Daemon.fx.fiatCurrency
}
RowLayout {
Image {
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
source: '../../../icons/lightning.png'
}
Label {
text: qsTr('can receive:')
font.pixelSize: constants.fontSizeSmall
color: Material.accentColor
}
}
Label {
Layout.alignment: Qt.AlignRight
text: formattedLightningCanReceive
font.family: FixedFont
}
Label {
font.pixelSize: constants.fontSizeSmall
color: Material.accentColor
text: Config.baseUnit
}
Item {
visible: Daemon.fx.enabled
Layout.preferredHeight: 1
Layout.preferredWidth: 1
}
Label {
Layout.alignment: Qt.AlignRight
visible: Daemon.fx.enabled
font.pixelSize: constants.fontSizeSmall
color: constants.mutedForeground
text: formattedLightningCanReceiveFiat
}
Label {
visible: Daemon.fx.enabled
font.pixelSize: constants.fontSizeSmall
color: constants.mutedForeground
text: Daemon.fx.fiatCurrency
}
RowLayout {
Image {
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
source: '../../../icons/lightning.png'
}
Label {
text: qsTr('can send:')
font.pixelSize: constants.fontSizeSmall
color: Material.accentColor
}
}
Label {
Layout.alignment: Qt.AlignRight
text: formattedLightningCanSend
font.family: FixedFont
}
Label {
font.pixelSize: constants.fontSizeSmall
color: Material.accentColor
text: Config.baseUnit
}
Item {
visible: Daemon.fx.enabled
Layout.preferredHeight: 1
Layout.preferredWidth: 1
}
Label {
Layout.alignment: Qt.AlignRight
visible: Daemon.fx.enabled
font.pixelSize: constants.fontSizeSmall
color: constants.mutedForeground
text: formattedLightningCanSendFiat
}
Label {
visible: Daemon.fx.enabled
font.pixelSize: constants.fontSizeSmall
color: constants.mutedForeground
text: Daemon.fx.fiatCurrency
}
}
}

Loading…
Cancel
Save