From 87bb63e4427a92fa01403d855c85967dbb5493a3 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Mon, 23 Feb 2026 13:03:47 +0100 Subject: [PATCH] qml: use standard Button for buttons outside of buttoncontainer --- .../gui/qml/components/ChannelDetails.qml | 24 ++++------ electrum/gui/qml/components/SwapDialog.qml | 41 ++++++++--------- .../wizard/WCScriptAndDerivation.qml | 46 ++++++++----------- 3 files changed, 45 insertions(+), 66 deletions(-) diff --git a/electrum/gui/qml/components/ChannelDetails.qml b/electrum/gui/qml/components/ChannelDetails.qml index 42d55c37d..d43e1efdd 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 12bd5d668..d3eead881 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 9464c8912..80d7d07cd 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() } } - } }