Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions electrum/gui/qml/components/Addresses.qml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ Pane {

placeholderText: qsTr('search')
inputMethodHints: Qt.ImhNoPredictiveText
rightPadding: constants.iconSizeMedium + 2 * constants.paddingSmall

onTextChanged: listview.filterModel.filterText = text

Image {
anchors.right: parent.right
anchors.rightMargin: constants.paddingSmall
anchors.verticalCenter: parent.verticalCenter
source: Qt.resolvedUrl('../../icons/zoom.png')
sourceSize.width: constants.iconSizeMedium
Expand Down Expand Up @@ -276,6 +278,15 @@ Pane {
}

}

MouseArea { // unfocus the search box when clicking elsewhere
anchors.fill: parent
onPressed: function(mouse) {
mouse.accepted = false
searchEdit.focus = false
}
}

property color navigationBarBackgroundColor: constants.highlightBackground

Component {
Expand Down
2 changes: 2 additions & 0 deletions electrum/gui/qml/components/Channels.qml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Pane {

FormattedAmount {
amount: Daemon.currentWallet.lightningCanSend
redacted: Config.hideAmounts
}

Label {
Expand All @@ -55,6 +56,7 @@ Pane {

FormattedAmount {
amount: Daemon.currentWallet.lightningCanReceive
redacted: Config.hideAmounts
}
}

Expand Down
26 changes: 26 additions & 0 deletions electrum/gui/qml/components/Preferences.qml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,31 @@ Pane {
}
}

RowLayout {
Layout.columnSpan: 2
Layout.fillWidth: true
spacing: 0
Switch {
id: hideAmounts
checked: Config.hideAmounts
onCheckedChanged: {
if (activeFocus) {
Config.hideAmounts = checked
let hint = app.messageDialog.createObject(app, {
title: qsTr('Did you know?'),
text: qsTr('You can also toggle this by long-pressing the balance on the home screen.'),
})
hint.open()
}
}
}
Label {
Layout.fillWidth: true
text: qsTr('Hide amounts')
wrapMode: Text.Wrap
}
}

Label {
text: qsTr('Exchange rate provider')
enabled: Daemon.fx.enabled
Expand Down Expand Up @@ -499,6 +524,7 @@ Pane {
thousands.checked = Config.thousandsSeparator
currencies.currentIndex = currencies.indexOfValue(Daemon.fx.fiatCurrency)
historicRates.checked = Daemon.fx.historicRates
hideAmounts.checked = Config.hideAmounts
rateSources.currentIndex = rateSources.indexOfValue(Daemon.fx.rateSource)
fiatEnable.checked = Daemon.fx.enabled
spendUnconfirmed.checked = Config.spendUnconfirmed
Expand Down
2 changes: 1 addition & 1 deletion electrum/gui/qml/components/controls/AddressDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ItemDelegate {
}
Label {
font.family: FixedFont
text: Config.formatSats(model.balance, false)
text: Config.formatSats(model.balance, false, Config.hideAmounts)

@accumulator accumulator Jun 11, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

visible: model.balance.satsInt != 0
}
Label {
Expand Down
231 changes: 137 additions & 94 deletions electrum/gui/qml/components/controls/BalanceSummary.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ Item {
property string formattedLightningBalance

function setBalances() {
root.formattedConfirmedBalance = Config.formatSats(Daemon.currentWallet.confirmedBalance)
root.formattedTotalBalance = Config.formatSats(Daemon.currentWallet.totalBalance)
root.formattedLightningBalance = Config.formatSats(Daemon.currentWallet.lightningBalance)
let hide = Config.hideAmounts
root.formattedConfirmedBalance = Config.formatSats(Daemon.currentWallet.confirmedBalance, false, hide)
root.formattedTotalBalance = Config.formatSats(Daemon.currentWallet.totalBalance, false, hide)
root.formattedLightningBalance = Config.formatSats(Daemon.currentWallet.lightningBalance, false, hide)

@accumulator accumulator Jun 11, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. here

if (Daemon.fx.enabled) {
root.formattedTotalBalanceFiat = Daemon.fx.fiatValue(Daemon.currentWallet.totalBalance, false)
}
Expand All @@ -28,127 +29,168 @@ Item {
leftPadding: constants.paddingXLarge
rightPadding: constants.paddingXLarge

GridLayout {
id: balanceLayout
columns: 3
opacity: Daemon.currentWallet.synchronizing || !Network.isConnected ? 0 : 1
Item {
implicitWidth: Math.max(
balanceLayout.implicitWidth,
syncLabel.implicitWidth,
statusLabel.implicitWidth,
)
implicitHeight: balanceLayout.implicitHeight

Label {
font.pixelSize: constants.fontSizeXLarge
text: qsTr('Balance') + ':'
color: Material.accentColor
}
GridLayout {
id: balanceLayout
anchors.centerIn: parent
columns: 3
opacity: Daemon.currentWallet.synchronizing || !Network.isConnected ? 0 : 1

Label {
Layout.alignment: Qt.AlignRight
font.pixelSize: constants.fontSizeXLarge
font.family: FixedFont
text: formattedTotalBalance
}
Label {
font.pixelSize: constants.fontSizeXLarge
color: Material.accentColor
text: Config.baseUnit
}
Label {
Layout.row: 0
Layout.column: 0
font.pixelSize: constants.fontSizeXLarge
text: qsTr('Balance') + ':'
color: Material.accentColor
}

Item {
visible: Daemon.fx.enabled
Layout.preferredWidth: 1
}
Label {
Layout.alignment: Qt.AlignRight
visible: Daemon.fx.enabled
font.pixelSize: constants.fontSizeLarge
font.family: FixedFont
color: constants.mutedForeground
text: formattedTotalBalanceFiat
}
Label {
visible: Daemon.fx.enabled
font.pixelSize: constants.fontSizeLarge
color: constants.mutedForeground
text: Daemon.fx.fiatCurrency
}
Label {
Layout.row: 0
Layout.column: 1
Layout.alignment: Qt.AlignRight
font.pixelSize: constants.fontSizeXLarge
font.family: FixedFont
text: formattedTotalBalance
}
Label {
Layout.row: 0
Layout.column: 2
font.pixelSize: constants.fontSizeXLarge
visible: !Config.hideAmounts
color: Material.accentColor
text: Config.baseUnit
}

RowLayout {
Layout.alignment: Qt.AlignRight
visible: Daemon.currentWallet.isLightning
Image {
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
source: '../../../icons/lightning.png'
Item {
Layout.row: 1
Layout.column: 0
visible: Daemon.fx.enabled && !Config.hideAmounts
Layout.preferredWidth: 1
}
Label {
Layout.row: 1
Layout.column: 1
Layout.alignment: Qt.AlignRight
visible: Daemon.fx.enabled && !Config.hideAmounts
font.pixelSize: constants.fontSizeLarge
font.family: FixedFont
color: constants.mutedForeground
text: formattedTotalBalanceFiat
}
Label {
text: qsTr('Lightning') + ':'
Layout.row: 1
Layout.column: 2
visible: Daemon.fx.enabled && !Config.hideAmounts
font.pixelSize: constants.fontSizeLarge
color: constants.mutedForeground
text: Daemon.fx.fiatCurrency
}

RowLayout {
Layout.row: 2
Layout.column: 0
Layout.alignment: Qt.AlignRight
visible: Daemon.currentWallet.isLightning
Image {
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
source: '../../../icons/lightning.png'
}
Label {
text: qsTr('Lightning') + ':'
font.pixelSize: constants.fontSizeSmall
color: Material.accentColor
}
}
Label {
Layout.row: 2
Layout.column: 1
visible: Daemon.currentWallet.isLightning
Layout.alignment: Qt.AlignRight
text: formattedLightningBalance
font.family: FixedFont
}
Label {
Layout.row: 2
Layout.column: 2
visible: Daemon.currentWallet.isLightning && !Config.hideAmounts
font.pixelSize: constants.fontSizeSmall
color: Material.accentColor
text: Config.baseUnit
}
}
Label {
visible: Daemon.currentWallet.isLightning
Layout.alignment: Qt.AlignRight
text: formattedLightningBalance
font.family: FixedFont
}
Label {
visible: Daemon.currentWallet.isLightning
font.pixelSize: constants.fontSizeSmall
color: Material.accentColor
text: Config.baseUnit
}

RowLayout {
Layout.alignment: Qt.AlignRight
visible: Daemon.currentWallet.isLightning
Image {
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
source: '../../../icons/bitcoin.png'
RowLayout {
Layout.row: 3
Layout.column: 0
Layout.alignment: Qt.AlignRight
visible: Daemon.currentWallet.isLightning
Image {
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
source: '../../../icons/bitcoin.png'
}
Label {
text: qsTr('On-chain') + ':'
font.pixelSize: constants.fontSizeSmall
color: Material.accentColor
}
}
Label {
text: qsTr('On-chain') + ':'
id: formattedConfirmedBalanceLabel
Layout.row: 3
Layout.column: 1
visible: Daemon.currentWallet.isLightning
Layout.alignment: Qt.AlignRight
text: formattedConfirmedBalance
font.family: FixedFont
}
Label {
Layout.row: 3
Layout.column: 2
visible: Daemon.currentWallet.isLightning && !Config.hideAmounts
font.pixelSize: constants.fontSizeSmall
color: Material.accentColor
text: Config.baseUnit
}
}

Label {
id: formattedConfirmedBalanceLabel
visible: Daemon.currentWallet.isLightning
Layout.alignment: Qt.AlignRight
text: formattedConfirmedBalance
font.family: FixedFont
id: syncLabel
opacity: Daemon.currentWallet.synchronizing && Network.isConnected ? 1 : 0
anchors.centerIn: parent
text: Daemon.currentWallet.synchronizingProgress
color: Material.accentColor
font.pixelSize: constants.fontSizeLarge
}

Label {
visible: Daemon.currentWallet.isLightning
font.pixelSize: constants.fontSizeSmall
id: statusLabel
opacity: !Network.isConnected ? 1 : 0
anchors.centerIn: parent
text: Network.serverStatus
color: Material.accentColor
text: Config.baseUnit
font.pixelSize: constants.fontSizeLarge
}
}

}

Label {
opacity: Daemon.currentWallet.synchronizing && Network.isConnected ? 1 : 0
anchors.centerIn: balancePane
text: Daemon.currentWallet.synchronizingProgress
color: Material.accentColor
font.pixelSize: constants.fontSizeLarge
}

Label {
opacity: !Network.isConnected ? 1 : 0
anchors.centerIn: balancePane
text: Network.serverStatus
color: Material.accentColor
font.pixelSize: constants.fontSizeLarge
}

MouseArea {
anchors.fill: parent
onClicked: {
app.stack.push(Qt.resolvedUrl('../BalanceDetails.qml'))
}
onPressAndHold: {
Config.hideAmounts = !Config.hideAmounts
AppController.haptic()
}
}

// instead of all these explicit connections, we should expose
Expand All @@ -157,6 +199,7 @@ Item {
target: Config
function onBaseUnitChanged() { setBalances() }
function onThousandsSeparatorChanged() { setBalances() }
function onHideAmountsChanged() { setBalances() }
}

Connections {
Expand Down
3 changes: 2 additions & 1 deletion electrum/gui/qml/components/controls/ChannelDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,13 @@ ItemDelegate {
}

Label {
text: Config.formatSats(model.capacity)
text: Config.formatSats(model.capacity, false, Config.hideAmounts)
font.family: FixedFont
color: _closed ? constants.mutedForeground : Material.foreground
}

Label {
visible: !Config.hideAmounts
text: Config.baseUnit
color: _closed ? constants.mutedForeground : Material.accentColor
}
Expand Down
Loading