pub struct ModalConfig {Show 13 fields
pub animation: ModalAnimation,
pub presentation: ModalPresentation,
pub status_bar_translucent: bool,
pub orientations: u8,
pub close_on_escape: bool,
pub close_on_backdrop_press: bool,
pub close_on_swipe: bool,
pub window: NodeId,
pub detents: Vec<SheetDetent>,
pub detent: Option<SheetDetent>,
pub default_detent: Option<SheetDetent>,
pub grabber: bool,
pub largest_undimmed_detent: Option<SheetDetent>,
}Expand description
Options of a modal (Dialog).
The modal itself has no look: on the desktops and the web it is a
transparent layer over the whole window (no card, scrim, shadow or
background; presentation is ignored), and what shows is the app’s
popup and backdrop, which the runtime renders inside it.
Fields§
§animation: ModalAnimationHow it appears.
presentation: ModalPresentationHow it covers the screen (iOS).
status_bar_translucent: boolAndroid: the content reaches under the status bar.
orientations: u8iOS: the orientations it allows (ModalConfig::PORTRAIT, …);
0 keeps the presenter’s.
close_on_escape: boolEscape and the Android back button close it natively
(closeOnEscape); either way they report
crate::EventKind::RequestClose (reason "cancel"), and
crate::EventKind::Dismiss after closing.
close_on_backdrop_press: boolA press on the backdrop closes it (closeOnBackdropPress): the
runtime handles presses on the app’s backdrop part; a platform
reads it only for a backdrop of its own (a native sheet’s).
close_on_swipe: boolSwiping a sheet down closes it natively (closeOnSwipe).
window: NodeIdThe window it shows in (desktops): crate::ROOT_ID, the main
window, or the root of the app’s window of its own that holds it
(a dialog opened from a <Window>’s content shows over that
window, not the main one). For a window’s own root: the window
holding its node. The core works it out from where the node is.
detents: Vec<SheetDetent>iOS sheets: the heights it rests at (detents); empty for the
system’s full height.
detent: Option<SheetDetent>iOS sheets: the detent the app keeps it at (detent); applied when
it changes.
default_detent: Option<SheetDetent>iOS sheets: the detent it opens at without Self::detent
(defaultDetent); None for the smallest.
grabber: booliOS sheets: the system’s grabber shows (grabber).
largest_undimmed_detent: Option<SheetDetent>iOS sheets: up to this detent what is behind is not dimmed and
takes touches (largestUndimmedDetent).
Implementations§
Source§impl ModalConfig
impl ModalConfig
Sourcepub const PORTRAIT_UPSIDE_DOWN: u8 = 2
pub const PORTRAIT_UPSIDE_DOWN: u8 = 2
portrait-upside-down.
Sourcepub const LANDSCAPE_LEFT: u8 = 4
pub const LANDSCAPE_LEFT: u8 = 4
landscape-left.
Sourcepub const LANDSCAPE_RIGHT: u8 = 8
pub const LANDSCAPE_RIGHT: u8 = 8
landscape-right.