From 3046c0bbaeb790abb145a8c4664af3a0307a2ae3 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 3 Jun 2022 13:26:45 +0200 Subject: [PATCH] rename ConfirmInvoiceDialog to InvoiceDialog and style buttons like RequestDialog --- ...irmInvoiceDialog.qml => InvoiceDialog.qml} | 22 +++++++++++++------ electrum/gui/qml/components/RequestDialog.qml | 2 +- electrum/gui/qml/components/Send.qml | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) rename electrum/gui/qml/components/{ConfirmInvoiceDialog.qml => InvoiceDialog.qml} (86%) diff --git a/electrum/gui/qml/components/ConfirmInvoiceDialog.qml b/electrum/gui/qml/components/InvoiceDialog.qml similarity index 86% rename from electrum/gui/qml/components/ConfirmInvoiceDialog.qml rename to electrum/gui/qml/components/InvoiceDialog.qml index 6a18bc583..cb9f5a848 100644 --- a/electrum/gui/qml/components/ConfirmInvoiceDialog.qml +++ b/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: { diff --git a/electrum/gui/qml/components/RequestDialog.qml b/electrum/gui/qml/components/RequestDialog.qml index e0aa4af40..5f21f70b8 100644 --- a/electrum/gui/qml/components/RequestDialog.qml +++ b/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 diff --git a/electrum/gui/qml/components/Send.qml b/electrum/gui/qml/components/Send.qml index 495656a58..32422390f 100644 --- a/electrum/gui/qml/components/Send.qml +++ b/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, {