From 8a3d9fd75869be974a429c8be28c873f9b5c8a82 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 14 Jan 2026 16:51:45 +0000 Subject: [PATCH] qml: FeePicker: restrict abs/rate editing to mimic wallet.bump_fee/cpfp --- .../gui/qml/components/CpfpBumpFeeDialog.qml | 1 + .../gui/qml/components/RbfBumpFeeDialog.qml | 2 +- .../gui/qml/components/RbfCancelDialog.qml | 2 +- .../gui/qml/components/controls/FeePicker.qml | 48 +++++++++++-------- 4 files changed, 31 insertions(+), 22 deletions(-) diff --git a/electrum/gui/qml/components/CpfpBumpFeeDialog.qml b/electrum/gui/qml/components/CpfpBumpFeeDialog.qml index d68f9edc7..1c8f7b127 100644 --- a/electrum/gui/qml/components/CpfpBumpFeeDialog.qml +++ b/electrum/gui/qml/components/CpfpBumpFeeDialog.qml @@ -147,6 +147,7 @@ ElDialog { Layout.fillWidth: true finalizer: dialog.cpfpfeebumper showTxInfo: false + allowPickerFeeRates: false } } } diff --git a/electrum/gui/qml/components/RbfBumpFeeDialog.qml b/electrum/gui/qml/components/RbfBumpFeeDialog.qml index a96add281..4d9fdcf9c 100644 --- a/electrum/gui/qml/components/RbfBumpFeeDialog.qml +++ b/electrum/gui/qml/components/RbfBumpFeeDialog.qml @@ -116,7 +116,7 @@ ElDialog { id: feepicker width: parent.width finalizer: dialog.rbffeebumper - + allowPickerAbsFees: false } } diff --git a/electrum/gui/qml/components/RbfCancelDialog.qml b/electrum/gui/qml/components/RbfCancelDialog.qml index b39100413..b8832b10d 100644 --- a/electrum/gui/qml/components/RbfCancelDialog.qml +++ b/electrum/gui/qml/components/RbfCancelDialog.qml @@ -88,7 +88,7 @@ ElDialog { id: feepicker width: parent.width finalizer: dialog.txcanceller - + allowPickerAbsFees: false } } diff --git a/electrum/gui/qml/components/controls/FeePicker.qml b/electrum/gui/qml/components/controls/FeePicker.qml index df97d5bef..0fe96b734 100644 --- a/electrum/gui/qml/components/controls/FeePicker.qml +++ b/electrum/gui/qml/components/controls/FeePicker.qml @@ -18,6 +18,8 @@ Item { property bool showTxInfo: true property bool showPicker: true + property bool allowPickerAbsFees: true + property bool allowPickerFeeRates: true property bool manualFeeEntry: finalizer.method == FeeSlider.FSMethod.MANUAL @@ -121,24 +123,22 @@ Item { } } - Label { + RowLayout { + Layout.columnSpan: 2 Layout.fillWidth: true - Layout.preferredWidth: 1 - text: qsTr('Rate') - color: Material.accentColor - visible: showPicker && manualFeeEntry - } + visible: showPicker && manualFeeEntry && allowPickerFeeRates - GridLayout { - Layout.preferredWidth: 2 - Layout.rowSpan: 2 - visible: showPicker && manualFeeEntry - columns: 2 - columnSpacing: constants.paddingMedium + Label { + Layout.fillWidth: true + Layout.preferredWidth: 1 + text: qsTr('Rate') + color: Material.accentColor + } TextField { id: rate Layout.fillWidth: true + Layout.preferredWidth: 2 text: finalizer.userFeerate color: finalizer.isUserFeerateLast ? Material.foreground : Material.accentColor inputMethodHints: Qt.ImhDigitsOnly @@ -152,13 +152,28 @@ Item { Label { Layout.fillWidth: true + Layout.preferredWidth: 1 color: Material.accentColor text: UI_UNIT_NAME.FEERATE_SAT_PER_VBYTE } + } + + RowLayout { + Layout.columnSpan: 2 + Layout.fillWidth: true + visible: showPicker && manualFeeEntry && allowPickerAbsFees + + Label { + Layout.fillWidth: true + Layout.preferredWidth: 1 + color: Material.accentColor + text: qsTr('Total') + } TextField { id: absolute Layout.fillWidth: true + Layout.preferredWidth: 2 text: finalizer.userFee color: finalizer.isUserFeerateLast ? Material.accentColor : Material.foreground inputMethodHints: Qt.ImhDigitsOnly @@ -172,18 +187,11 @@ Item { Label { Layout.fillWidth: true + Layout.preferredWidth: 1 color: Material.accentColor text: UI_UNIT_NAME.FIXED_SAT } } - Label { - Layout.fillWidth: true - Layout.preferredWidth: 1 - visible: showPicker && manualFeeEntry - color: Material.accentColor - text: qsTr('Total') - } - } }