Struct ModalSpec
pub struct ModalSpec<'a> {
pub title: &'a str,
pub closable: bool,
pub actions: &'a [ModalAction<'a>],
pub platform: PlatformConventions,
pub body_height: f64,
pub max_width: f64,
pub close_hovered: bool,
pub close_focused: bool,
pub dismiss_on_scrim: bool,
}Expand description
What a modal is being asked to frame.
Fields§
§title: &'a strThe sheet’s title, set in the Title role.
closable: boolDraw a close control. Escape always dismisses; this is its visible half, for a sheet with no Cancel action.
actions: &'a [ModalAction<'a>]Actions in semantic authoring order. Geometry follows
Self::platform, so callers do not branch on native button order.
platform: PlatformConventionsNative shortcut and dialog presentation conventions.
body_height: f64Height the caller’s body content wants, in the same logical pixels as the rest of the layout (already grown by the text scale).
max_width: f64Widest the sheet may be drawn, in design pixels. Defaults to
MODAL_MAX_WIDTH.
close_hovered: bool§close_focused: bool§dismiss_on_scrim: boolWhether a scrim click dismisses. The scrim swallows the click either way: a surface that lets clicks through is not modal.
Implementations§
§impl<'a> ModalSpec<'a>
impl<'a> ModalSpec<'a>
pub fn new(title: &'a str) -> ModalSpec<'a>
pub fn actions(self, actions: &'a [ModalAction<'a>]) -> ModalSpec<'a>
pub fn platform_conventions( self, platform: PlatformConventions, ) -> ModalSpec<'a>
pub fn body_height(self, h: f64) -> ModalSpec<'a>
pub fn max_width(self, w: f64) -> ModalSpec<'a>
pub fn closable(self, v: bool) -> ModalSpec<'a>
pub fn dismiss_on_scrim(self, v: bool) -> ModalSpec<'a>
pub fn close_hovered(self, v: bool) -> ModalSpec<'a>
pub fn close_focused(self, v: bool) -> ModalSpec<'a>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ModalSpec<'a>
impl<'a> RefUnwindSafe for ModalSpec<'a>
impl<'a> Send for ModalSpec<'a>
impl<'a> Sync for ModalSpec<'a>
impl<'a> Unpin for ModalSpec<'a>
impl<'a> UnsafeUnpin for ModalSpec<'a>
impl<'a> UnwindSafe for ModalSpec<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.