qml: don't add navigationbar padding when on-screen keyboard is visible, also allow stackview pages to override navigationbar background color to allow correct color runoff below buttons
What changed, and why it matters
This commit is a user-interface polish change for Electrum's mobile/QML layout. It stops adding extra bottom padding when the on-screen keyboard is visible, and lets individual pages set the background color of the navigation-bar area so the screen looks consistent. There is no security issue visible in the changes.
No security action needed; this is a normal UI/UX fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies QML components in electrum/gui/qml/components. It adds a navigationBarBackgroundColor property to several page components and uses it in main.qml to color the navigation-bar spacer. It also changes ElDialog.qml so bottom padding for the Android navigation bar is only added when the on-screen keyboard is not visible (app.keyboardFreeZone.state != 'visible'). The Wallets.qml change wraps the ‘Create Wallet’ FlatButton in a ButtonContainer. All changes are cosmetic/layout-related.
Changed components
electrum/gui/qml/components/main.qmlelectrum/gui/qml/components/controls/ElDialog.qmlelectrum/gui/qml/components/Addresses.qmlelectrum/gui/qml/components/ChannelDetails.qmlelectrum/gui/qml/components/Channels.qmlelectrum/gui/qml/components/Invoices.qmlelectrum/gui/qml/components/NetworkOverview.qmlelectrum/gui/qml/components/ReceiveRequests.qmlelectrum/gui/qml/components/TxDetails.qmlelectrum/gui/qml/components/WalletDetails.qmlelectrum/gui/qml/components/WalletMainView.qmlelectrum/gui/qml/components/Wallets.qmlInspect captured patch +41 / −20
diff --git a/electrum/gui/qml/components/Addresses.qml b/electrum/gui/qml/components/Addresses.qml
index 4da07dd..71d4411 100644
--- a/electrum/gui/qml/components/Addresses.qml
+++ b/electrum/gui/qml/components/Addresses.qml
@@ -276,6 +276,7 @@ Pane {
}
}
+ property color navigationBarBackgroundColor: constants.highlightBackground
Component {
id: sectionDelegate
diff --git a/electrum/gui/qml/components/ChannelDetails.qml b/electrum/gui/qml/components/ChannelDetails.qml
index ab18e6e..42d55c3 100644
--- a/electrum/gui/qml/components/ChannelDetails.qml
+++ b/electrum/gui/qml/components/ChannelDetails.qml
@@ -466,8 +466,8 @@ Pane {
}
}
}
-
}
+ property color navigationBarBackgroundColor: constants.highlightBackground
ChannelDetails {
id: channeldetails
diff --git a/electrum/gui/qml/components/Channels.qml b/electrum/gui/qml/components/Channels.qml
index 4b015ac..ea8c128 100644
--- a/electrum/gui/qml/components/Channels.qml
+++ b/electrum/gui/qml/components/Channels.qml
@@ -155,8 +155,8 @@ Pane {
icon.source: '../../icons/lightning.png'
}
}
-
}
+ property color navigationBarBackgroundColor: constants.highlightBackground
Component {
id: openChannelDialog
diff --git a/electrum/gui/qml/components/Invoices.qml b/electrum/gui/qml/components/Invoices.qml
index f4767d7..513449f 100644
--- a/electrum/gui/qml/components/Invoices.qml
+++ b/electrum/gui/qml/components/Invoices.qml
@@ -112,4 +112,6 @@ Pane {
}
}
}
+ property color navigationBarBackgroundColor: constants.highlightBackground
+
}
diff --git a/electrum/gui/qml/components/NetworkOverview.qml b/electrum/gui/qml/components/NetworkOverview.qml
index 12ffdc6..ffb893c 100644
--- a/electrum/gui/qml/components/NetworkOverview.qml
+++ b/electrum/gui/qml/components/NetworkOverview.qml
@@ -314,6 +314,7 @@ Pane {
}
}
}
+ property color navigationBarBackgroundColor: constants.highlightBackground
Component {
id: serverConfig
diff --git a/electrum/gui/qml/components/ReceiveRequests.qml b/electrum/gui/qml/components/ReceiveRequests.qml
index ffdd99c..e389a48 100644
--- a/electrum/gui/qml/components/ReceiveRequests.qml
+++ b/electrum/gui/qml/components/ReceiveRequests.qml
@@ -107,4 +107,5 @@ Pane {
}
}
}
+ property color navigationBarBackgroundColor: constants.highlightBackground
}
diff --git a/electrum/gui/qml/components/TxDetails.qml b/electrum/gui/qml/components/TxDetails.qml
index 42f462a..0a5d217 100644
--- a/electrum/gui/qml/components/TxDetails.qml
+++ b/electrum/gui/qml/components/TxDetails.qml
@@ -480,6 +480,7 @@ Pane {
}
}
+ property color navigationBarBackgroundColor: constants.highlightBackground
TxDetails {
id: txdetails
diff --git a/electrum/gui/qml/components/WalletDetails.qml b/electrum/gui/qml/components/WalletDetails.qml
index 2676c58..de2337e 100644
--- a/electrum/gui/qml/components/WalletDetails.qml
+++ b/electrum/gui/qml/components/WalletDetails.qml
@@ -518,6 +518,7 @@ Pane {
}
}
}
+ property color navigationBarBackgroundColor: constants.highlightBackground
Connections {
target: Daemon
diff --git a/electrum/gui/qml/components/WalletMainView.qml b/electrum/gui/qml/components/WalletMainView.qml
index 593e49f..8fdbb64 100644
--- a/electrum/gui/qml/components/WalletMainView.qml
+++ b/electrum/gui/qml/components/WalletMainView.qml
@@ -325,6 +325,7 @@ Item {
}
}
}
+ property color navigationBarBackgroundColor: constants.highlightBackground
PIResolver {
id: piResolver
diff --git a/electrum/gui/qml/components/Wallets.qml b/electrum/gui/qml/components/Wallets.qml
index 635bd19..e98e82c 100644
--- a/electrum/gui/qml/components/Wallets.qml
+++ b/electrum/gui/qml/components/Wallets.qml
@@ -116,27 +116,31 @@ Pane {
}
- FlatButton {
+ ButtonContainer {
Layout.fillWidth: true
- text: qsTr('Create Wallet')
- icon.source: '../../icons/add.png'
- onClicked: {
- if (Daemon.availableWallets.rowCount() > 0 && Config.walletShouldUseSinglePassword
- && (!Daemon.singlePassword || Daemon.numWalletsWithPassword(Daemon.singlePassword) < 1)) {
- // if the user has wallets but hasn't unlocked any wallet yet force them to do so.
- // this ensures they know at least one wallets password and can complete the wizard
- // where they will need to enter the password of an existing wallet.
- var dialog = app.messageDialog.createObject(app, {
- title: qsTr('Wallet unlock required'),
- text: qsTr("You have to unlock any existing wallet first before creating a new wallet."),
- })
- dialog.open()
- } else {
- rootItem.createWallet()
+ FlatButton {
+ Layout.fillWidth: true
+ text: qsTr('Create Wallet')
+ icon.source: '../../icons/add.png'
+ onClicked: {
+ if (Daemon.availableWallets.rowCount() > 0 && Config.walletShouldUseSinglePassword
+ && (!Daemon.singlePassword || Daemon.numWalletsWithPassword(Daemon.singlePassword) < 1)) {
+ // if the user has wallets but hasn't unlocked any wallet yet force them to do so.
+ // this ensures they know at least one wallets password and can complete the wizard
+ // where they will need to enter the password of an existing wallet.
+ var dialog = app.messageDialog.createObject(app, {
+ title: qsTr('Wallet unlock required'),
+ text: qsTr("You have to unlock any existing wallet first before creating a new wallet."),
+ })
+ dialog.open()
+ } else {
+ rootItem.createWallet()
+ }
}
}
}
}
+ property color navigationBarBackgroundColor: constants.highlightBackground
Connections {
target: Daemon
diff --git a/electrum/gui/qml/components/controls/ElDialog.qml b/electrum/gui/qml/components/controls/ElDialog.qml
index 2c75728..b90402c 100644
--- a/electrum/gui/qml/components/controls/ElDialog.qml
+++ b/electrum/gui/qml/components/controls/ElDialog.qml
@@ -17,7 +17,7 @@ Dialog {
property bool _wasOpened: false
// Add bottom padding for Android navigation bar if needed
- bottomPadding: needsSystemBarPadding ? app.navigationBarHeight : 0
+ bottomPadding: needsSystemBarPadding && app.keyboardFreeZone.state != 'visible' ? app.navigationBarHeight : 0
// called to finally close dialog after checks by onClosing handler in main.qml
function doClose() {
diff --git a/electrum/gui/qml/components/main.qml b/electrum/gui/qml/components/main.qml
index ce01372..7e4d7d2 100644
--- a/electrum/gui/qml/components/main.qml
+++ b/electrum/gui/qml/components/main.qml
@@ -36,6 +36,7 @@ ApplicationWindow
property alias stack: mainStackView
property alias keyboardFreeZone: _keyboardFreeZone
property alias infobanner: _infobanner
+ property color _navigationBarBackgroundColor: 'transparent'
property string pendingIntent: ""
@@ -287,13 +288,21 @@ ApplicationWindow
mainStackView.clear()
mainStackView.push(Qt.resolvedUrl(item_url))
}
+ function updateStylingFromItem(item) {
+ _navigationBarBackgroundColor = item && 'navigationBarBackgroundColor' in item
+ ? item.navigationBarBackgroundColor
+ : 'transparent'
+ }
+ onCurrentItemChanged: updateStylingFromItem(currentItem)
}
// Add bottom padding for navigation bar on Android when UI is edge-to-edge
Item {
- visible: app.navigationBarHeight > 0
+ visible: app.navigationBarHeight > 0 && _keyboardFreeZone.state != 'visible'
Layout.fillWidth: true
Layout.preferredHeight: app.navigationBarHeight
+
+ Rectangle { anchors.fill: parent; color: _navigationBarBackgroundColor }
}
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.