Skip to main content

Module modal

Module modal 

Source
Expand description

The stack of modal surfaces that are open right now.

Modality is a user-interface fact — a dialog is open, everything behind it is inert — while the back gesture is a platform one. This registry is where they meet: dialogs push themselves on while they are composed, and the application shell asks the innermost one to close when the platform reports a back request. Nothing outside the framework registers or dispatches.

Structs§

ModalRegistration
Keeps a modal surface on the stack until it is dropped.

Functions§

clear_modals
Clears every registration. Used by tests and by host teardown so one composition’s modals never outlive it.
dispatch_modal_back
Asks the innermost modal surface to close.
local_modal_depth
CompositionLocal carrying the modal depth at which content is being composed: zero outside any dialog, or the depth of the innermost dialog that encloses the current composition.
modal_depth
How many modal surfaces are open. Reading this in a composable subscribes to it, so the reader recomposes when a modal opens or closes.
register_modal
Pushes a modal surface onto the stack. The innermost registration is the one dispatch_modal_back asks to close.