Browse Source

support stacking dialogs

master
Sander van Grieken 3 years ago
parent
commit
cabf8e0644
  1. 4
      electrum/gui/qml/components/controls/ElDialog.qml
  2. 5
      electrum/gui/qml/components/main.qml

4
electrum/gui/qml/components/controls/ElDialog.qml

@ -9,9 +9,9 @@ Dialog {
onOpenedChanged: { onOpenedChanged: {
if (opened) { if (opened) {
app.activeDialog = abstractdialog app.activeDialogs.push(abstractdialog)
} else { } else {
app.activeDialog = null app.activeDialogs.pop()
} }
} }
} }

5
electrum/gui/qml/components/main.qml

@ -27,7 +27,7 @@ ApplicationWindow
property alias stack: mainStackView property alias stack: mainStackView
property Dialog activeDialog: null property variant activeDialogs: []
header: ToolBar { header: ToolBar {
id: toolbar id: toolbar
@ -228,8 +228,9 @@ ApplicationWindow
} }
onClosing: { onClosing: {
if (activeDialog) { if (activeDialogs.length > 0) {
console.log('dialog on top') console.log('dialog on top')
var activeDialog = activeDialogs.pop()
if (activeDialog.allowClose) { if (activeDialog.allowClose) {
activeDialog.close() activeDialog.close()
} }

Loading…
Cancel
Save