Rename "keep" close confirmation to "cancel"
This commit is contained in:
parent
571ed60954
commit
5b9047ea85
@ -92,8 +92,8 @@ public struct Window: AdwaitaSceneElement {
|
||||
|
||||
/// Close the window.
|
||||
case close
|
||||
/// Keep the window.
|
||||
case keep
|
||||
/// Cancel the closing process and keep the window.
|
||||
case cancel
|
||||
|
||||
}
|
||||
|
||||
@ -262,7 +262,7 @@ public struct Window: AdwaitaSceneElement {
|
||||
}
|
||||
}
|
||||
if let onClose {
|
||||
storage.fields["on-close"] = { onClose() == .keep } as (() -> Bool)
|
||||
storage.fields["on-close"] = { onClose() == .cancel } as (() -> Bool)
|
||||
}
|
||||
storage.previousState = self
|
||||
}
|
||||
|
||||
@ -212,7 +212,7 @@ struct Demo: App {
|
||||
window
|
||||
.size(width: $width, height: $height)
|
||||
.maximized($maximized)
|
||||
.onClose { closeAlert = !destroy; return destroy ? .close : .keep }
|
||||
.onClose { closeAlert = !destroy; return destroy ? .close : .cancel }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user