Browse Source

qml: move fee bump button below fee amount

master
Sander van Grieken 3 years ago
parent
commit
049a59f57a
  1. 45
      electrum/gui/qml/components/TxDetails.qml

45
electrum/gui/qml/components/TxDetails.qml

@ -105,23 +105,27 @@ Pane {
FormattedAmount { FormattedAmount {
Layout.fillWidth: true Layout.fillWidth: true
amount: txdetails.fee amount: txdetails.fee
singleLine: !(txdetails.canBump || txdetails.canCpfp)
} }
FlatButton { }
Layout.fillWidth: true
Layout.minimumWidth: implicitWidth Item {
icon.source: '../../icons/warning.png' visible: feebumpButton.visible
icon.color: 'transparent' Layout.preferredWidth: 1 ; Layout.preferredHeight: 1
text: qsTr('Bump fee') }
visible: txdetails.canBump || txdetails.canCpfp FlatButton {
onClicked: { id: feebumpButton
if (txdetails.canBump) { visible: txdetails.canBump || txdetails.canCpfp
var dialog = rbfBumpFeeDialog.createObject(root, { txid: root.txid }) textUnderIcon: false
} else { icon.source: '../../icons/warning.png'
var dialog = cpfpBumpFeeDialog.createObject(root, { txid: root.txid }) icon.color: 'transparent'
} text: qsTr('Bump fee')
dialog.open() onClicked: {
if (txdetails.canBump) {
var dialog = rbfBumpFeeDialog.createObject(root, { txid: root.txid })
} else {
var dialog = cpfpBumpFeeDialog.createObject(root, { txid: root.txid })
} }
dialog.open()
} }
} }
@ -385,27 +389,24 @@ Pane {
rawtx: root.rawtx rawtx: root.rawtx
onLabelChanged: root.detailsChanged() onLabelChanged: root.detailsChanged()
onConfirmRemoveLocalTx: { onConfirmRemoveLocalTx: {
var dialog = app.messageDialog.createObject(app, {'text': message, 'yesno': true}) var dialog = app.messageDialog.createObject(app, { text: message, yesno: true })
dialog.yesClicked.connect(function() { dialog.yesClicked.connect(function() {
dialog.close() dialog.close()
txdetails.removeLocalTx(true) txdetails.removeLocalTx(true)
txdetails.wallet.historyModel.init_model(true)
root.close() root.close()
}) })
dialog.open() dialog.open()
} }
onSaveTxSuccess: { onSaveTxSuccess: {
var dialog = app.messageDialog.createObject(app, { var dialog = app.messageDialog.createObject(app, {
'text': qsTr('Transaction added to wallet history.') + '\n\n' + text: qsTr('Transaction added to wallet history.') + '\n\n' +
qsTr('Note: this is an offline transaction, if you want the network to see it, you need to broadcast it.') qsTr('Note: this is an offline transaction, if you want the network to see it, you need to broadcast it.')
}) })
dialog.open() dialog.open()
root.close() root.close()
} }
onSaveTxError: { onSaveTxError: {
var dialog = app.messageDialog.createObject(app, { var dialog = app.messageDialog.createObject(app, { text: message })
'text': message
})
dialog.open() dialog.open()
} }
} }

Loading…
Cancel
Save