Browse Source

rename ConfirmInvoiceDialog to InvoiceDialog and style buttons like RequestDialog

patch-4
Sander van Grieken 3 years ago
parent
commit
3046c0bbae
  1. 22
      electrum/gui/qml/components/InvoiceDialog.qml
  2. 2
      electrum/gui/qml/components/RequestDialog.qml
  3. 2
      electrum/gui/qml/components/Send.qml

22
electrum/gui/qml/components/ConfirmInvoiceDialog.qml → electrum/gui/qml/components/InvoiceDialog.qml

@ -19,6 +19,7 @@ Dialog {
height: parent.height
title: qsTr('Invoice')
standardButtons: invoice_key != '' ? Dialog.Close : Dialog.Cancel
modal: true
parent: Overlay.overlay
@ -60,7 +61,6 @@ Dialog {
text: invoice.message
Layout.fillWidth: true
wrapMode: Text.Wrap
maximumLineCount: 4
elide: Text.ElideRight
}
@ -98,7 +98,14 @@ Dialog {
text: invoice.status_str
}
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
Rectangle {
height: 1
Layout.fillWidth: true
Layout.columnSpan: 2
color: Material.accentColor
}
Item { Layout.preferredHeight: constants.paddingLarge; Layout.preferredWidth: 1 }
RowLayout {
Layout.columnSpan: 2
@ -107,6 +114,7 @@ Dialog {
Button {
text: qsTr('Delete')
icon.source: '../../icons/delete.png'
visible: invoice_key != ''
onClicked: {
invoice.wallet.delete_invoice(invoice_key)
@ -114,13 +122,10 @@ Dialog {
}
}
Button {
text: qsTr('Cancel')
onClicked: dialog.close()
}
Button {
text: qsTr('Save')
icon.source: '../../icons/save.png'
visible: invoice_key == ''
enabled: invoice.invoiceType == Invoice.OnchainInvoice
onClicked: {
invoice.save_invoice()
@ -130,6 +135,7 @@ Dialog {
Button {
text: qsTr('Pay now')
icon.source: '../../icons/confirmed.png'
enabled: invoice.invoiceType != Invoice.Invalid // TODO && has funds
onClicked: {
invoice.save_invoice()
@ -141,6 +147,8 @@ Dialog {
}
}
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
}
Component.onCompleted: {

2
electrum/gui/qml/components/RequestDialog.qml

@ -15,7 +15,7 @@ Dialog {
parent: Overlay.overlay
modal: true
standardButtons: Dialog.Ok
standardButtons: Dialog.Close
width: parent.width
height: parent.height

2
electrum/gui/qml/components/Send.qml

@ -228,7 +228,7 @@ Pane {
Component {
id: confirmInvoiceDialog
ConfirmInvoiceDialog {
InvoiceDialog {
onDoPay: {
if (invoice.invoiceType == Invoice.OnchainInvoice) {
var dialog = confirmPaymentDialog.createObject(rootItem, {

Loading…
Cancel
Save