-
-
Notifications
You must be signed in to change notification settings - Fork 65
Add Window scene, openWindow action, dismissWindow action, fix window close handling, and add multi-window support to WindowGroup
#284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…sing it properly in the example)
…sing it properly in the example)
…ng `openWindow(id:)`
…into `GenericWindow`/`GenericWindowNode`
47fe499 to
dd75f60
Compare
#Conflicts: # Examples/Sources/WindowingExample/WindowingApp.swift # Sources/SwiftCrossUI/Environment/Actions/DismissAction.swift # Sources/SwiftCrossUI/Environment/EnvironmentValues.swift
Window scene and openWindow environment actionWindow scene and openWindow environment action, and add multi-window support to WindowGroup
Window scene and openWindow environment action, and add multi-window support to WindowGroupWindow scene, openWindow action, dismissWindow action, fix window close handling, and add multi-window support to WindowGroup
|
While reviewing #299, I realised that closing windows will need special consideration in WinUIBackend. Currently, WinUIBackend stores a list of all open windows, for the purpose of selecting one of them to attach to when modals are presented without a specific window. You'll either need to update that list when windows get closed, or update WinUIBackend's various modal implementations to get a default window to use in some other way. |
|
I'll take the "update the window list" route, thanks for the catch! |
It looks like you're way ahead of yourself here: window.closed.addHandler { _, _ in
self.windows.removeAll { other in
window === other
}
} |
cfabcb7 to
c0288d0
Compare
This PR:
close(window:)andsetCloseHandler(ofWindow:to:), have been implemented in all supported backends as well as in DummyBackendWindowscene and its associatedWindowNodeWindowcan be open at a timeWindowrequires a title and an IDWindowGroupdismissWindowenvironment action, which closes the enclosing windowopenWindowenvironment action, which opens aWindoworWindowGroupgiven its ID (partially deals with Add a way for window groups to be reopened #250)internal)WindowReferencetypedefaultLaunchBehavior(_:)scene modifier, which controls whether scenes appear on app launchautomaticoption matches the current behavior, namely thatWindowGroups are opened on app launch butWindows aren'tsupportsMultipleWindowsenvironment value, which can be used to check whether the current platform supports multi-window