Struct ModalProps
pub struct ModalProps {Show 14 fields
pub title: String,
pub icon: Option<Icon>,
pub description: Option<String>,
pub open: bool,
pub primary: Option<String>,
pub secondary: Option<String>,
pub tertiary: Option<String>,
pub destructive: bool,
pub primary_enabled: bool,
pub body: Vec<Box<dyn Widget>>,
pub act_primary: Event,
pub act_secondary: Event,
pub act_tertiary: Event,
pub dismiss: Event,
}Expand description
A question over the window: a dimmed page, a sheet with a title, the view’s content, and up to three answers. Escape or a click on the scrim closes it; Enter fires the main answer, except in a destructive question, where Enter is the safe one.
Fields§
§title: StringWhat the question is, as its title (name the action: “Delete 3 notes?”).
icon: Option<Icon>A glyph before the title naming what asks.
description: Option<String>What assistive technology says after the title.
open: boolWhether it is open. A closed dialog paints nothing and takes no input.
primary: Option<String>The main answer’s label (“Delete”): the inverted button, and what Enter fires.
secondary: Option<String>The other answer’s label, usually Cancel. Escape fires it.
tertiary: Option<String>A third answer’s label, standing apart (“Don’t save”). Enter never fires it.
destructive: boolThe main answer destroys something: it is a destructive button, and Enter is the safe answer instead.
primary_enabled: boolThe main answer cannot be taken yet. A dialog with this has it disabled.
body: Vec<Box<dyn Widget>>The view’s content, inside the sheet.
act_primary: EventThe main answer was taken.
act_secondary: EventThe other answer was taken.
act_tertiary: EventThe third answer was taken.
dismiss: EventIt was closed (Escape, the scrim, or a click on Cancel): a dialog with this closes as it is.
Trait Implementations§
§impl Component for ModalProps
impl Component for ModalProps
fn describe() -> Description
§fn from_source(source: &mut dyn Source) -> Result<ModalProps, Error>
fn from_source(source: &mut dyn Source) -> Result<ModalProps, Error>
source gives. Read more§impl Default for ModalProps
impl Default for ModalProps
§fn default() -> ModalProps
fn default() -> ModalProps
Auto Trait Implementations§
impl Freeze for ModalProps
impl !RefUnwindSafe for ModalProps
impl !Send for ModalProps
impl !Sync for ModalProps
impl Unpin for ModalProps
impl UnsafeUnpin for ModalProps
impl !UnwindSafe for ModalProps
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
§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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§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>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§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>
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>
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