1
0

support stacking dialogs

This commit is contained in:
Sander van Grieken
2022-09-26 13:55:54 +02:00
parent d4df633f22
commit cabf8e0644
2 changed files with 5 additions and 4 deletions

View File

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

View File

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