qml: include dialogs in back button navigation
This commit is contained in:
@@ -157,6 +157,6 @@ Pane {
|
|||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: swapDialog
|
id: swapDialog
|
||||||
Swap {}
|
SwapDialog {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.electrum 1.0
|
|||||||
|
|
||||||
import "controls"
|
import "controls"
|
||||||
|
|
||||||
Dialog {
|
ElDialog {
|
||||||
id: dialog
|
id: dialog
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.electrum 1.0
|
|||||||
|
|
||||||
import "controls"
|
import "controls"
|
||||||
|
|
||||||
Dialog {
|
ElDialog {
|
||||||
id: dialog
|
id: dialog
|
||||||
|
|
||||||
required property QtObject finalizer
|
required property QtObject finalizer
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import QtQuick.Controls.Material 2.0
|
|||||||
|
|
||||||
import "controls"
|
import "controls"
|
||||||
|
|
||||||
Dialog {
|
ElDialog {
|
||||||
id: dialog
|
id: dialog
|
||||||
|
|
||||||
property string text
|
property string text
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.electrum 1.0
|
|||||||
|
|
||||||
import "controls"
|
import "controls"
|
||||||
|
|
||||||
Dialog {
|
ElDialog {
|
||||||
id: dialog
|
id: dialog
|
||||||
|
|
||||||
property Invoice invoice
|
property Invoice invoice
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.electrum 1.0
|
|||||||
|
|
||||||
import "controls"
|
import "controls"
|
||||||
|
|
||||||
Dialog {
|
ElDialog {
|
||||||
id: dialog
|
id: dialog
|
||||||
|
|
||||||
required property string invoice_key
|
required property string invoice_key
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ import QtQuick.Layouts 1.0
|
|||||||
import QtQuick.Controls 2.3
|
import QtQuick.Controls 2.3
|
||||||
import QtQuick.Controls.Material 2.0
|
import QtQuick.Controls.Material 2.0
|
||||||
|
|
||||||
Dialog {
|
import "controls"
|
||||||
|
|
||||||
|
ElDialog {
|
||||||
id: dialog
|
id: dialog
|
||||||
title: qsTr("Message")
|
title: qsTr("Message")
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.electrum 1.0
|
|||||||
|
|
||||||
import "controls"
|
import "controls"
|
||||||
|
|
||||||
Dialog {
|
ElDialog {
|
||||||
id: passworddialog
|
id: passworddialog
|
||||||
|
|
||||||
title: qsTr("Enter Password")
|
title: qsTr("Enter Password")
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.electrum 1.0
|
|||||||
|
|
||||||
import "controls"
|
import "controls"
|
||||||
|
|
||||||
Dialog {
|
ElDialog {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
title: qsTr('PIN')
|
title: qsTr('PIN')
|
||||||
@@ -31,6 +31,8 @@ Dialog {
|
|||||||
|
|
||||||
property bool canCancel: true
|
property bool canCancel: true
|
||||||
|
|
||||||
|
allowClose: canCancel
|
||||||
|
|
||||||
property string mode // [check, enter, change]
|
property string mode // [check, enter, change]
|
||||||
property string pincode // old one passed in when change, new one passed out
|
property string pincode // old one passed in when change, new one passed out
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.electrum 1.0
|
|||||||
|
|
||||||
import "controls"
|
import "controls"
|
||||||
|
|
||||||
Dialog {
|
ElDialog {
|
||||||
id: dialog
|
id: dialog
|
||||||
title: qsTr('Payment Request')
|
title: qsTr('Payment Request')
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.electrum 1.0
|
|||||||
|
|
||||||
import "controls"
|
import "controls"
|
||||||
|
|
||||||
Dialog {
|
ElDialog {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
17
electrum/gui/qml/components/controls/ElDialog.qml
Normal file
17
electrum/gui/qml/components/controls/ElDialog.qml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import QtQuick 2.6
|
||||||
|
import QtQuick.Layouts 1.0
|
||||||
|
import QtQuick.Controls 2.3
|
||||||
|
|
||||||
|
Dialog {
|
||||||
|
id: abstractdialog
|
||||||
|
|
||||||
|
property bool allowClose: true
|
||||||
|
|
||||||
|
onOpenedChanged: {
|
||||||
|
if (opened) {
|
||||||
|
app.activeDialog = abstractdialog
|
||||||
|
} else {
|
||||||
|
app.activeDialog = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,6 +27,8 @@ ApplicationWindow
|
|||||||
|
|
||||||
property alias stack: mainStackView
|
property alias stack: mainStackView
|
||||||
|
|
||||||
|
property Dialog activeDialog: null
|
||||||
|
|
||||||
header: ToolBar {
|
header: ToolBar {
|
||||||
id: toolbar
|
id: toolbar
|
||||||
|
|
||||||
@@ -205,6 +207,14 @@ ApplicationWindow
|
|||||||
}
|
}
|
||||||
|
|
||||||
onClosing: {
|
onClosing: {
|
||||||
|
if (activeDialog) {
|
||||||
|
console.log('dialog on top')
|
||||||
|
if (activeDialog.allowClose) {
|
||||||
|
activeDialog.close()
|
||||||
|
}
|
||||||
|
close.accepted = false
|
||||||
|
return
|
||||||
|
}
|
||||||
if (stack.depth > 1) {
|
if (stack.depth > 1) {
|
||||||
close.accepted = false
|
close.accepted = false
|
||||||
stack.pop()
|
stack.pop()
|
||||||
|
|||||||
Reference in New Issue
Block a user