Browse Source

qml: FeePicker parameterize enable display of tx info and picker, use this for CPFP

to put picker in Total section
master
Sander van Grieken 2 years ago
parent
commit
016e500993
No known key found for this signature in database
GPG Key ID: 9BCF8209EA402EBA
  1. 20
      electrum/gui/qml/components/CpfpBumpFeeDialog.qml
  2. 12
      electrum/gui/qml/components/controls/FeePicker.qml

20
electrum/gui/qml/components/CpfpBumpFeeDialog.qml

@ -65,15 +65,16 @@ ElDialog {
TextHighlightPane { TextHighlightPane {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
height: feepicker.height height: feepicker_childinfo.height
FeePicker { FeePicker {
id: feepicker id: feepicker_childinfo
width: parent.width width: parent.width
finalizer: dialog.cpfpfeebumper finalizer: dialog.cpfpfeebumper
targetLabel: qsTr('Target total') targetLabel: qsTr('Target total')
feeLabel: qsTr('Fee for child') feeLabel: qsTr('Fee for child')
feeRateLabel: qsTr('Fee rate for child') feeRateLabel: qsTr('Fee rate for child')
showPicker: false
} }
} }
@ -82,13 +83,11 @@ ElDialog {
Layout.topMargin: constants.paddingSmall Layout.topMargin: constants.paddingSmall
text: qsTr('Total') text: qsTr('Total')
color: Material.accentColor color: Material.accentColor
visible: cpfpfeebumper.valid
} }
TextHighlightPane { TextHighlightPane {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
visible: cpfpfeebumper.valid
GridLayout { GridLayout {
width: parent.width width: parent.width
@ -104,7 +103,9 @@ ElDialog {
Label { Label {
Layout.preferredWidth: 2 Layout.preferredWidth: 2
Layout.fillWidth: true Layout.fillWidth: true
text: cpfpfeebumper.totalSize + ' ' + UI_UNIT_NAME.TXSIZE_VBYTES text: cpfpfeebumper.valid
? cpfpfeebumper.totalSize + ' ' + UI_UNIT_NAME.TXSIZE_VBYTES
: ''
} }
Label { Label {
@ -118,6 +119,7 @@ ElDialog {
Layout.preferredWidth: 2 Layout.preferredWidth: 2
Layout.fillWidth: true Layout.fillWidth: true
amount: cpfpfeebumper.totalFee amount: cpfpfeebumper.totalFee
valid: cpfpfeebumper.valid
} }
Label { Label {
@ -141,6 +143,14 @@ ElDialog {
color: Material.accentColor color: Material.accentColor
} }
} }
FeePicker {
id: feepicker
Layout.columnSpan: 2
Layout.fillWidth: true
finalizer: dialog.cpfpfeebumper
showTxInfo: false
}
} }
} }

12
electrum/gui/qml/components/controls/FeePicker.qml

@ -16,6 +16,9 @@ Item {
property string feeLabel: qsTr('Mining fee') property string feeLabel: qsTr('Mining fee')
property string feeRateLabel: qsTr('Fee rate') property string feeRateLabel: qsTr('Fee rate')
property bool showTxInfo: true
property bool showPicker: true
implicitHeight: rootLayout.height implicitHeight: rootLayout.height
GridLayout { GridLayout {
@ -28,6 +31,7 @@ Item {
Layout.preferredWidth: 1 Layout.preferredWidth: 1
text: feeLabel text: feeLabel
color: Material.accentColor color: Material.accentColor
visible: showTxInfo
} }
FormattedAmount { FormattedAmount {
@ -35,6 +39,7 @@ Item {
Layout.preferredWidth: 2 Layout.preferredWidth: 2
amount: finalizer.fee amount: finalizer.fee
valid: finalizer.valid valid: finalizer.valid
visible: showTxInfo
} }
Label { Label {
@ -42,11 +47,13 @@ Item {
Layout.preferredWidth: 1 Layout.preferredWidth: 1
text: feeRateLabel text: feeRateLabel
color: Material.accentColor color: Material.accentColor
visible: showTxInfo
} }
RowLayout { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredWidth: 2 Layout.preferredWidth: 2
visible: showTxInfo
Label { Label {
id: feeRate id: feeRate
text: finalizer.valid ? finalizer.feeRate : '' text: finalizer.valid ? finalizer.feeRate : ''
@ -54,6 +61,7 @@ Item {
} }
Label { Label {
Layout.fillWidth: true
text: finalizer.valid ? UI_UNIT_NAME.FEERATE_SAT_PER_VBYTE : '' text: finalizer.valid ? UI_UNIT_NAME.FEERATE_SAT_PER_VBYTE : ''
color: Material.accentColor color: Material.accentColor
} }
@ -64,18 +72,20 @@ Item {
Layout.preferredWidth: 1 Layout.preferredWidth: 1
text: targetLabel text: targetLabel
color: Material.accentColor color: Material.accentColor
visible: showPicker
} }
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredWidth: 2 Layout.preferredWidth: 2
id: targetdesc
text: finalizer.target text: finalizer.target
visible: showPicker
} }
RowLayout { RowLayout {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
visible: showPicker
Slider { Slider {
id: feeslider id: feeslider

Loading…
Cancel
Save