Skip to content

Commit b4d13ff

Browse files
committed
qml: show balance summary on top
1 parent ff5ba7c commit b4d13ff

File tree

2 files changed

+102
-62
lines changed

2 files changed

+102
-62
lines changed

electrum/gui/qml/components/BalanceSummary.qml

Lines changed: 89 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import QtQuick.Controls.Material 2.0
55

66
Frame {
77
id: root
8-
height: layout.height
8+
99
font.pixelSize: constants.fontSizeMedium
1010

1111
property string formattedBalance
@@ -35,97 +35,124 @@ Frame {
3535

3636
columns: 2
3737
Label {
38-
font.pixelSize: constants.fontSizeLarge
39-
text: qsTr('Balance: ')
38+
font.pixelSize: constants.fontSizeXLarge
39+
text: qsTr('Balance:')
40+
color: Material.accentColor
41+
Layout.alignment: Qt.AlignRight | Qt.AlignTop
4042
}
41-
RowLayout {
42-
Label {
43-
font.pixelSize: constants.fontSizeLarge
44-
font.family: FixedFont
45-
text: formattedBalance
46-
}
47-
Label {
48-
font.pixelSize: constants.fontSizeMedium
49-
color: Material.accentColor
50-
text: Config.baseUnit
43+
ColumnLayout {
44+
spacing: 0
45+
46+
RowLayout {
47+
Label {
48+
font.pixelSize: constants.fontSizeXLarge
49+
font.family: FixedFont
50+
text: formattedBalance
51+
}
52+
Label {
53+
font.pixelSize: constants.fontSizeXLarge
54+
color: Material.accentColor
55+
text: Config.baseUnit
56+
}
5157
}
58+
5259
Label {
53-
font.pixelSize: constants.fontSizeMedium
54-
text: Daemon.fx.enabled
55-
? '(' + root.formattedBalanceFiat + ' ' + Daemon.fx.fiatCurrency + ')'
56-
: ''
60+
visible: Daemon.fx.enabled
61+
font.pixelSize: constants.fontSizeSmall
62+
color: constants.mutedForeground
63+
text: root.formattedBalanceFiat + ' ' + Daemon.fx.fiatCurrency
5764
}
5865
}
66+
5967
Label {
6068
visible: Daemon.currentWallet.unconfirmedBalance.satsInt > 0
61-
font.pixelSize: constants.fontSizeSmall
62-
text: qsTr('Unconfirmed: ')
69+
font.pixelSize: constants.fontSizeLarge
70+
text: qsTr('Unconfirmed:')
71+
color: Material.accentColor
72+
Layout.alignment: Qt.AlignRight | Qt.AlignTop
6373
}
64-
RowLayout {
74+
ColumnLayout {
6575
visible: Daemon.currentWallet.unconfirmedBalance.satsInt > 0
66-
Label {
67-
font.pixelSize: constants.fontSizeSmall
68-
font.family: FixedFont
69-
text: formattedUnconfirmed
76+
spacing: 0
77+
RowLayout {
78+
Label {
79+
font.pixelSize: constants.fontSizeLarge
80+
font.family: FixedFont
81+
text: formattedUnconfirmed
82+
}
83+
Label {
84+
font.pixelSize: constants.fontSizeLarge
85+
color: Material.accentColor
86+
text: Config.baseUnit
87+
}
7088
}
7189
Label {
90+
visible: Daemon.fx.enabled
7291
font.pixelSize: constants.fontSizeSmall
73-
color: Material.accentColor
74-
text: Config.baseUnit
75-
}
76-
Label {
77-
font.pixelSize: constants.fontSizeSmall
78-
text: Daemon.fx.enabled
79-
? '(' + root.formattedUnconfirmedFiat + ' ' + Daemon.fx.fiatCurrency + ')'
80-
: ''
92+
color: constants.mutedForeground
93+
text: root.formattedUnconfirmedFiat + ' ' + Daemon.fx.fiatCurrency
8194
}
8295
}
96+
8397
Label {
8498
visible: Daemon.currentWallet.frozenBalance.satsInt > 0
85-
font.pixelSize: constants.fontSizeSmall
86-
text: qsTr('Frozen: ')
99+
font.pixelSize: constants.fontSizeLarge
100+
text: qsTr('Frozen:')
101+
color: Material.accentColor
102+
Layout.alignment: Qt.AlignRight | Qt.AlignTop
87103
}
88-
RowLayout {
104+
ColumnLayout {
89105
visible: Daemon.currentWallet.frozenBalance.satsInt > 0
90-
Label {
91-
font.pixelSize: constants.fontSizeSmall
92-
font.family: FixedFont
93-
text: root.formattedFrozen
94-
}
95-
Label {
96-
font.pixelSize: constants.fontSizeSmall
97-
color: Material.accentColor
98-
text: Config.baseUnit
106+
spacing: 0
107+
108+
RowLayout {
109+
Label {
110+
font.pixelSize: constants.fontSizeLarge
111+
font.family: FixedFont
112+
text: root.formattedFrozen
113+
}
114+
Label {
115+
font.pixelSize: constants.fontSizeLarge
116+
color: Material.accentColor
117+
text: Config.baseUnit
118+
}
99119
}
100120
Label {
121+
visible: Daemon.fx.enabled
101122
font.pixelSize: constants.fontSizeSmall
102-
text: Daemon.fx.enabled
103-
? '(' + root.formattedFrozenFiat + ' ' + Daemon.fx.fiatCurrency + ')'
104-
: ''
123+
color: constants.mutedForeground
124+
text: root.formattedFrozenFiat + ' ' + Daemon.fx.fiatCurrency
105125
}
106126
}
127+
107128
Label {
108129
visible: Daemon.currentWallet.isLightning
109-
font.pixelSize: constants.fontSizeSmall
110-
text: qsTr('Lightning: ')
130+
font.pixelSize: constants.fontSizeLarge
131+
text: qsTr('Lightning:')
132+
color: Material.accentColor
133+
Layout.alignment: Qt.AlignRight | Qt.AlignTop
111134
}
112-
RowLayout {
135+
ColumnLayout {
113136
visible: Daemon.currentWallet.isLightning
114-
Label {
115-
font.pixelSize: constants.fontSizeSmall
116-
font.family: FixedFont
117-
text: formattedLightningBalance
118-
}
119-
Label {
120-
font.pixelSize: constants.fontSizeSmall
121-
color: Material.accentColor
122-
text: Config.baseUnit
137+
spacing: 0
138+
139+
RowLayout {
140+
Label {
141+
font.pixelSize: constants.fontSizeLarge
142+
font.family: FixedFont
143+
text: formattedLightningBalance
144+
}
145+
Label {
146+
font.pixelSize: constants.fontSizeLarge
147+
color: Material.accentColor
148+
text: Config.baseUnit
149+
}
123150
}
124151
Label {
152+
visible: Daemon.fx.enabled
125153
font.pixelSize: constants.fontSizeSmall
126-
text: Daemon.fx.enabled
127-
? '(' + root.formattedLightningBalanceFiat + ' ' + Daemon.fx.fiatCurrency + ')'
128-
: ''
154+
color: constants.mutedForeground
155+
text: root.formattedLightningBalanceFiat + ' ' + Daemon.fx.fiatCurrency
129156
}
130157
}
131158
}

electrum/gui/qml/components/History.qml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ Pane {
2626

2727
model: visualModel
2828

29+
header: Item {
30+
width: parent.width
31+
height: headerLayout.height
32+
ColumnLayout {
33+
id: headerLayout
34+
anchors.centerIn: parent
35+
Item { height: constants.paddingXLarge; width: 1 }
36+
BalanceSummary {}
37+
Item { height: constants.paddingXLarge; width: 1 }
38+
}
39+
}
40+
headerPositioning: ListView.InlineHeader
41+
2942
readonly property variant sectionLabels: {
3043
'today': qsTr('Today'),
3144
'yesterday': qsTr('Yesterday'),

0 commit comments

Comments
 (0)