some more thoughts about state management
This commit is contained in:
parent
437e76067f
commit
b38ed2107b
13 changed files with 125 additions and 13 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue