qml: show balance summary on top
This commit is contained in:
@@ -5,7 +5,7 @@ import QtQuick.Controls.Material 2.0
|
|||||||
|
|
||||||
Frame {
|
Frame {
|
||||||
id: root
|
id: root
|
||||||
height: layout.height
|
|
||||||
font.pixelSize: constants.fontSizeMedium
|
font.pixelSize: constants.fontSizeMedium
|
||||||
|
|
||||||
property string formattedBalance
|
property string formattedBalance
|
||||||
@@ -35,97 +35,124 @@ Frame {
|
|||||||
|
|
||||||
columns: 2
|
columns: 2
|
||||||
Label {
|
Label {
|
||||||
|
font.pixelSize: constants.fontSizeXLarge
|
||||||
|
text: qsTr('Balance:')
|
||||||
|
color: Material.accentColor
|
||||||
|
Layout.alignment: Qt.AlignRight | Qt.AlignTop
|
||||||
|
}
|
||||||
|
ColumnLayout {
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Label {
|
||||||
|
font.pixelSize: constants.fontSizeXLarge
|
||||||
|
font.family: FixedFont
|
||||||
|
text: formattedBalance
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
font.pixelSize: constants.fontSizeXLarge
|
||||||
|
color: Material.accentColor
|
||||||
|
text: Config.baseUnit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: Daemon.fx.enabled
|
||||||
|
font.pixelSize: constants.fontSizeSmall
|
||||||
|
color: constants.mutedForeground
|
||||||
|
text: root.formattedBalanceFiat + ' ' + Daemon.fx.fiatCurrency
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: Daemon.currentWallet.unconfirmedBalance.satsInt > 0
|
||||||
font.pixelSize: constants.fontSizeLarge
|
font.pixelSize: constants.fontSizeLarge
|
||||||
text: qsTr('Balance: ')
|
text: qsTr('Unconfirmed:')
|
||||||
|
color: Material.accentColor
|
||||||
|
Layout.alignment: Qt.AlignRight | Qt.AlignTop
|
||||||
}
|
}
|
||||||
RowLayout {
|
ColumnLayout {
|
||||||
Label {
|
|
||||||
font.pixelSize: constants.fontSizeLarge
|
|
||||||
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 {
|
|
||||||
visible: Daemon.currentWallet.unconfirmedBalance.satsInt > 0
|
visible: Daemon.currentWallet.unconfirmedBalance.satsInt > 0
|
||||||
font.pixelSize: constants.fontSizeSmall
|
spacing: 0
|
||||||
text: qsTr('Unconfirmed: ')
|
RowLayout {
|
||||||
}
|
Label {
|
||||||
RowLayout {
|
font.pixelSize: constants.fontSizeLarge
|
||||||
visible: Daemon.currentWallet.unconfirmedBalance.satsInt > 0
|
font.family: FixedFont
|
||||||
Label {
|
text: formattedUnconfirmed
|
||||||
font.pixelSize: constants.fontSizeSmall
|
}
|
||||||
font.family: FixedFont
|
Label {
|
||||||
text: formattedUnconfirmed
|
font.pixelSize: constants.fontSizeLarge
|
||||||
|
color: Material.accentColor
|
||||||
|
text: Config.baseUnit
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
|
visible: Daemon.fx.enabled
|
||||||
font.pixelSize: constants.fontSizeSmall
|
font.pixelSize: constants.fontSizeSmall
|
||||||
color: Material.accentColor
|
color: constants.mutedForeground
|
||||||
text: Config.baseUnit
|
text: root.formattedUnconfirmedFiat + ' ' + Daemon.fx.fiatCurrency
|
||||||
}
|
|
||||||
Label {
|
|
||||||
font.pixelSize: constants.fontSizeSmall
|
|
||||||
text: Daemon.fx.enabled
|
|
||||||
? '(' + root.formattedUnconfirmedFiat + ' ' + Daemon.fx.fiatCurrency + ')'
|
|
||||||
: ''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
visible: Daemon.currentWallet.frozenBalance.satsInt > 0
|
visible: Daemon.currentWallet.frozenBalance.satsInt > 0
|
||||||
font.pixelSize: constants.fontSizeSmall
|
font.pixelSize: constants.fontSizeLarge
|
||||||
text: qsTr('Frozen: ')
|
text: qsTr('Frozen:')
|
||||||
|
color: Material.accentColor
|
||||||
|
Layout.alignment: Qt.AlignRight | Qt.AlignTop
|
||||||
}
|
}
|
||||||
RowLayout {
|
ColumnLayout {
|
||||||
visible: Daemon.currentWallet.frozenBalance.satsInt > 0
|
visible: Daemon.currentWallet.frozenBalance.satsInt > 0
|
||||||
Label {
|
spacing: 0
|
||||||
font.pixelSize: constants.fontSizeSmall
|
|
||||||
font.family: FixedFont
|
RowLayout {
|
||||||
text: root.formattedFrozen
|
Label {
|
||||||
|
font.pixelSize: constants.fontSizeLarge
|
||||||
|
font.family: FixedFont
|
||||||
|
text: root.formattedFrozen
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
font.pixelSize: constants.fontSizeLarge
|
||||||
|
color: Material.accentColor
|
||||||
|
text: Config.baseUnit
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
|
visible: Daemon.fx.enabled
|
||||||
font.pixelSize: constants.fontSizeSmall
|
font.pixelSize: constants.fontSizeSmall
|
||||||
color: Material.accentColor
|
color: constants.mutedForeground
|
||||||
text: Config.baseUnit
|
text: root.formattedFrozenFiat + ' ' + Daemon.fx.fiatCurrency
|
||||||
}
|
|
||||||
Label {
|
|
||||||
font.pixelSize: constants.fontSizeSmall
|
|
||||||
text: Daemon.fx.enabled
|
|
||||||
? '(' + root.formattedFrozenFiat + ' ' + Daemon.fx.fiatCurrency + ')'
|
|
||||||
: ''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
visible: Daemon.currentWallet.isLightning
|
visible: Daemon.currentWallet.isLightning
|
||||||
font.pixelSize: constants.fontSizeSmall
|
font.pixelSize: constants.fontSizeLarge
|
||||||
text: qsTr('Lightning: ')
|
text: qsTr('Lightning:')
|
||||||
|
color: Material.accentColor
|
||||||
|
Layout.alignment: Qt.AlignRight | Qt.AlignTop
|
||||||
}
|
}
|
||||||
RowLayout {
|
ColumnLayout {
|
||||||
visible: Daemon.currentWallet.isLightning
|
visible: Daemon.currentWallet.isLightning
|
||||||
Label {
|
spacing: 0
|
||||||
font.pixelSize: constants.fontSizeSmall
|
|
||||||
font.family: FixedFont
|
RowLayout {
|
||||||
text: formattedLightningBalance
|
Label {
|
||||||
|
font.pixelSize: constants.fontSizeLarge
|
||||||
|
font.family: FixedFont
|
||||||
|
text: formattedLightningBalance
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
font.pixelSize: constants.fontSizeLarge
|
||||||
|
color: Material.accentColor
|
||||||
|
text: Config.baseUnit
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
|
visible: Daemon.fx.enabled
|
||||||
font.pixelSize: constants.fontSizeSmall
|
font.pixelSize: constants.fontSizeSmall
|
||||||
color: Material.accentColor
|
color: constants.mutedForeground
|
||||||
text: Config.baseUnit
|
text: root.formattedLightningBalanceFiat + ' ' + Daemon.fx.fiatCurrency
|
||||||
}
|
|
||||||
Label {
|
|
||||||
font.pixelSize: constants.fontSizeSmall
|
|
||||||
text: Daemon.fx.enabled
|
|
||||||
? '(' + root.formattedLightningBalanceFiat + ' ' + Daemon.fx.fiatCurrency + ')'
|
|
||||||
: ''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,19 @@ Pane {
|
|||||||
|
|
||||||
model: visualModel
|
model: visualModel
|
||||||
|
|
||||||
|
header: Item {
|
||||||
|
width: parent.width
|
||||||
|
height: headerLayout.height
|
||||||
|
ColumnLayout {
|
||||||
|
id: headerLayout
|
||||||
|
anchors.centerIn: parent
|
||||||
|
Item { height: constants.paddingXLarge; width: 1 }
|
||||||
|
BalanceSummary {}
|
||||||
|
Item { height: constants.paddingXLarge; width: 1 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
headerPositioning: ListView.InlineHeader
|
||||||
|
|
||||||
readonly property variant sectionLabels: {
|
readonly property variant sectionLabels: {
|
||||||
'today': qsTr('Today'),
|
'today': qsTr('Today'),
|
||||||
'yesterday': qsTr('Yesterday'),
|
'yesterday': qsTr('Yesterday'),
|
||||||
|
|||||||
Reference in New Issue
Block a user