qml: use standard Button for buttons outside of buttoncontainer
What changed, and why it matters
This commit is a user-interface cleanup in Electrum's mobile/QML app. It replaces custom-styled button wrappers with the standard Button component in three screens: channel freeze controls, swap provider selection, and wallet recovery. There is no security change—only visual consistency and simpler code.
No security action needed. Treat as a normal UI refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff removes Pane+Rectangle+FlatButton wrapper constructs in three QML files and uses a plain Button from QtQuick.Controls. The onClicked handlers, enabled logic, and visible bindings remain identical. No backend logic, validation, or security-sensitive behavior is modified.
Changed components
electrum/gui/qml/components/ChannelDetails.qmlelectrum/gui/qml/components/SwapDialog.qmlelectrum/gui/qml/components/wizard/WCScriptAndDerivation.qmlInspect captured patch +45 / −66
diff --git a/electrum/gui/qml/components/ChannelDetails.qml b/electrum/gui/qml/components/ChannelDetails.qml
index 42d55c3..d43e1ef 100644
--- a/electrum/gui/qml/components/ChannelDetails.qml
+++ b/electrum/gui/qml/components/ChannelDetails.qml
@@ -145,14 +145,10 @@ Pane {
Layout.fillWidth: true
Layout.preferredHeight: 1
}
- Pane {
- background: Rectangle { color: Material.dialogColor }
- padding: 0
- FlatButton {
- Layout.minimumWidth: implicitWidth
- text: channeldetails.frozenForSending ? qsTr('Unfreeze') : qsTr('Freeze')
- onClicked: channeldetails.freezeForSending()
- }
+ Button {
+ Layout.minimumWidth: implicitWidth
+ text: channeldetails.frozenForSending ? qsTr('Unfreeze') : qsTr('Freeze')
+ onClicked: channeldetails.freezeForSending()
}
}
@@ -182,14 +178,10 @@ Pane {
Layout.fillWidth: true
Layout.preferredHeight: 1
}
- Pane {
- background: Rectangle { color: Material.dialogColor }
- padding: 0
- FlatButton {
- Layout.minimumWidth: implicitWidth
- text: channeldetails.frozenForReceiving ? qsTr('Unfreeze') : qsTr('Freeze')
- onClicked: channeldetails.freezeForReceiving()
- }
+ Button {
+ Layout.minimumWidth: implicitWidth
+ text: channeldetails.frozenForReceiving ? qsTr('Unfreeze') : qsTr('Freeze')
+ onClicked: channeldetails.freezeForReceiving()
}
}
diff --git a/electrum/gui/qml/components/SwapDialog.qml b/electrum/gui/qml/components/SwapDialog.qml
index 12bd5d6..d3eead8 100644
--- a/electrum/gui/qml/components/SwapDialog.qml
+++ b/electrum/gui/qml/components/SwapDialog.qml
@@ -253,31 +253,26 @@ ElDialog {
}
- Pane {
+ Button {
Layout.alignment: Qt.AlignHCenter
visible: _swaphelper.isNostr()
- background: Rectangle { color: constants.darkerDialogBackground }
- padding: 0
-
- FlatButton {
- text: qsTr('Choose swap provider')
- enabled: _swaphelper.state != SwapHelper.Initializing
- && _swaphelper.state != SwapHelper.Started
- && _swaphelper.state != SwapHelper.Success
- && _swaphelper.availableSwapServers.count
- onClicked: {
- var dialog = app.nostrSwapServersDialog.createObject(app, {
- swaphelper: _swaphelper,
- selectedPubkey: Config.swapServerNPub
- })
- dialog.accepted.connect(function() {
- if (Config.swapServerNPub != dialog.selectedPubkey) {
- Config.swapServerNPub = dialog.selectedPubkey
- _swaphelper.setReadyState()
- }
- })
- dialog.open()
- }
+ text: qsTr('Choose swap provider')
+ enabled: _swaphelper.state != SwapHelper.Initializing
+ && _swaphelper.state != SwapHelper.Started
+ && _swaphelper.state != SwapHelper.Success
+ && _swaphelper.availableSwapServers.count
+ onClicked: {
+ var dialog = app.nostrSwapServersDialog.createObject(app, {
+ swaphelper: _swaphelper,
+ selectedPubkey: Config.swapServerNPub
+ })
+ dialog.accepted.connect(function() {
+ if (Config.swapServerNPub != dialog.selectedPubkey) {
+ Config.swapServerNPub = dialog.selectedPubkey
+ _swaphelper.setReadyState()
+ }
+ })
+ dialog.open()
}
}
diff --git a/electrum/gui/qml/components/wizard/WCScriptAndDerivation.qml b/electrum/gui/qml/components/wizard/WCScriptAndDerivation.qml
index 9464c89..80d7d07 100644
--- a/electrum/gui/qml/components/wizard/WCScriptAndDerivation.qml
+++ b/electrum/gui/qml/components/wizard/WCScriptAndDerivation.qml
@@ -186,39 +186,31 @@ WizardComponent {
iconStyle: InfoTextArea.IconStyle.Error
}
- Pane {
+ Button {
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: constants.paddingLarge
- padding: 0
visible: !isMultisig
- background: Rectangle {
- color: Qt.lighter(Material.dialogColor, 1.5)
- }
-
- FlatButton {
- text: qsTr('Detect Existing Accounts')
- onClicked: {
- var dialog = bip39recoveryDialog.createObject(mainLayout, {
- walletType: wizard_data['wallet_type'],
- seed: wizard_data['seed'],
- seedExtraWords: wizard_data['seed_extra_words']
- })
- dialog.accepted.connect(function () {
- // select matching script type button and set derivation path
- for (var i = 0; i < scripttypegroup.buttons.length; i++) {
- var btn = scripttypegroup.buttons[i]
- if (btn.visible && btn.scripttype == dialog.scriptType) {
- btn.checked = true
- derivationpathtext.text = dialog.derivationPath
- return
- }
+ text: qsTr('Detect Existing Accounts')
+ onClicked: {
+ var dialog = bip39recoveryDialog.createObject(mainLayout, {
+ walletType: wizard_data['wallet_type'],
+ seed: wizard_data['seed'],
+ seedExtraWords: wizard_data['seed_extra_words']
+ })
+ dialog.accepted.connect(function () {
+ // select matching script type button and set derivation path
+ for (var i = 0; i < scripttypegroup.buttons.length; i++) {
+ var btn = scripttypegroup.buttons[i]
+ if (btn.visible && btn.scripttype == dialog.scriptType) {
+ btn.checked = true
+ derivationpathtext.text = dialog.derivationPath
+ return
}
- })
- dialog.open()
- }
+ }
+ })
+ dialog.open()
}
}
-
}
}
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.