some more thoughts about state management

This commit is contained in:
Blue 2023-12-26 20:31:55 -03:00
parent 437e76067f
commit b38ed2107b
Signed by: blue
GPG key ID: 9B203B252A63EE38
13 changed files with 125 additions and 13 deletions

View file

@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Controls
Popup {
property bool closable: true
property bool inProgress: false
property string status: ""
@ -11,7 +12,7 @@ Popup {
focus: true
width: column.width + 60
height: column.height + 60
closePolicy: Popup.CloseOnEscape
closePolicy: closable ? Popup.CloseOnEscape : Popup.NoAutoClose
onClosed: inProgress = false
Column {
@ -32,11 +33,11 @@ Popup {
Button {
text: qsTr("Close")
anchors.horizontalCenter: parent.horizontalCenter
visible: !inProgress
visible: closable && !inProgress
onClicked: modal.close()
focus: true
Keys.onReturnPressed: {
if (!inProgress)
if (closable && !inProgress)
modal.close()
}
}