Rename "keep" close confirmation to "cancel"
Some checks failed
Deploy Docs / publish (push) Has been cancelled
SwiftLint / SwiftLint (push) Has been cancelled

This commit is contained in:
david-swift 2025-10-20 13:03:30 +02:00
parent 571ed60954
commit 5b9047ea85
2 changed files with 4 additions and 4 deletions

View File

@ -92,8 +92,8 @@ public struct Window: AdwaitaSceneElement {
/// Close the window. /// Close the window.
case close case close
/// Keep the window. /// Cancel the closing process and keep the window.
case keep case cancel
} }
@ -262,7 +262,7 @@ public struct Window: AdwaitaSceneElement {
} }
} }
if let onClose { if let onClose {
storage.fields["on-close"] = { onClose() == .keep } as (() -> Bool) storage.fields["on-close"] = { onClose() == .cancel } as (() -> Bool)
} }
storage.previousState = self storage.previousState = self
} }

View File

@ -212,7 +212,7 @@ struct Demo: App {
window window
.size(width: $width, height: $height) .size(width: $width, height: $height)
.maximized($maximized) .maximized($maximized)
.onClose { closeAlert = !destroy; return destroy ? .close : .keep } .onClose { closeAlert = !destroy; return destroy ? .close : .cancel }
} }
} }