From 3a90f3588893c0592ee7a5c45b9c9283fad2adc0 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 24 Feb 2023 12:11:54 +0100 Subject: [PATCH] qml: reintroduce receive requests list page --- electrum/gui/qml/components/ReceiveDialog.qml | 11 +++ .../gui/qml/components/ReceiveRequests.qml | 69 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 electrum/gui/qml/components/ReceiveRequests.qml diff --git a/electrum/gui/qml/components/ReceiveDialog.qml b/electrum/gui/qml/components/ReceiveDialog.qml index 79f8daca7..ac666c58a 100644 --- a/electrum/gui/qml/components/ReceiveDialog.qml +++ b/electrum/gui/qml/components/ReceiveDialog.qml @@ -255,6 +255,17 @@ ElDialog { id: buttons Layout.fillWidth: true + FlatButton { + Layout.fillWidth: true + Layout.preferredWidth: 1 + + icon.source: '../../icons/tab_receive.png' + text: qsTr('Requests') + onClicked: { + dialog.close() + app.stack.push(Qt.resolvedUrl('ReceiveRequests.qml')) + } + } FlatButton { Layout.fillWidth: true Layout.preferredWidth: 1 diff --git a/electrum/gui/qml/components/ReceiveRequests.qml b/electrum/gui/qml/components/ReceiveRequests.qml new file mode 100644 index 000000000..b4d285b4f --- /dev/null +++ b/electrum/gui/qml/components/ReceiveRequests.qml @@ -0,0 +1,69 @@ +import QtQuick 2.6 +import QtQuick.Layouts 1.0 +import QtQuick.Controls 2.3 +import QtQuick.Controls.Material 2.0 +import QtQml.Models 2.1 +import QtQml 2.6 + +import "controls" + +Pane { + id: root + + ColumnLayout { + anchors.fill: parent + + Heading { + text: qsTr('Receive requests') + } + + Frame { + background: PaneInsetBackground {} + + verticalPadding: 0 + horizontalPadding: 0 + Layout.fillHeight: true + Layout.fillWidth: true + + ListView { + id: listview + anchors.fill: parent + clip: true + + model: DelegateModel { + id: delegateModel + model: Daemon.currentWallet.requestModel + delegate: InvoiceDelegate { + onClicked: { + //var dialog = app.stack.getRoot().openInvoice(model.key) + // dialog.invoiceAmountChanged.connect(function () { + // Daemon.currentWallet.invoiceModel.init_model() + // }) + } + } + } + + add: Transition { + NumberAnimation { properties: 'scale'; from: 0.75; to: 1; duration: 500 } + NumberAnimation { properties: 'opacity'; from: 0; to: 1; duration: 500 } + } + addDisplaced: Transition { + SpringAnimation { properties: 'y'; duration: 200; spring: 5; damping: 0.5; mass: 2 } + } + + remove: Transition { + NumberAnimation { properties: 'scale'; to: 0.75; duration: 300 } + NumberAnimation { properties: 'opacity'; to: 0; duration: 300 } + } + removeDisplaced: Transition { + SequentialAnimation { + PauseAnimation { duration: 200 } + SpringAnimation { properties: 'y'; duration: 100; spring: 5; damping: 0.5; mass: 2 } + } + } + + ScrollIndicator.vertical: ScrollIndicator { } + } + } + } +}