Skip to main content

ModalConfig

Struct ModalConfig 

Source
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: ModalAnimation

How it appears.

§presentation: ModalPresentation

How it covers the screen (iOS).

§status_bar_translucent: bool

Android: the content reaches under the status bar.

§orientations: u8

iOS: the orientations it allows (ModalConfig::PORTRAIT, …); 0 keeps the presenter’s.

§close_on_escape: bool

Escape 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: bool

A 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: bool

Swiping a sheet down closes it natively (closeOnSwipe).

§window: NodeId

The 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: bool

iOS 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

Source

pub const PORTRAIT: u8 = 1

portrait.

Source

pub const PORTRAIT_UPSIDE_DOWN: u8 = 2

portrait-upside-down.

Source

pub const LANDSCAPE_LEFT: u8 = 4

landscape-left.

Source

pub const LANDSCAPE_RIGHT: u8 = 8

landscape-right.

Trait Implementations§

Source§

impl Clone for ModalConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ModalConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ModalConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ModalConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ModalConfig

Auto Trait Implementations§

§

impl Forget for ModalConfig

§

impl Freeze for ModalConfig

§

impl Move for ModalConfig

§

impl RefUnwindSafe for ModalConfig

§

impl Send for ModalConfig
where RawVecInner: Send,

§

impl Sync for ModalConfig
where RawVecInner: Sync,

§

impl Unpin for ModalConfig
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for ModalConfig

§

impl UnwindSafe for ModalConfig
where RawVecInner: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.