pub struct Dialog<'a, Message> { /* private fields */ }dialog only.Expand description
A dialog builder. Convert it into an Element to render.
Implementations§
Source§impl<'a, Message> Dialog<'a, Message>
impl<'a, Message> Dialog<'a, Message>
pub fn open(self, open: bool) -> Self
pub fn title(self, title: impl IntoFragment<'a>) -> Self
Sourcepub fn description(self, description: impl IntoFragment<'a>) -> Self
pub fn description(self, description: impl IntoFragment<'a>) -> Self
A line of muted text under the title.
Sourcepub fn body(self, body: impl Into<Element<'a, Message>>) -> Self
pub fn body(self, body: impl Into<Element<'a, Message>>) -> Self
Content between the header and the footer, such as a form.
Sourcepub fn action(self, action: impl Into<Element<'a, Message>>) -> Self
pub fn action(self, action: impl Into<Element<'a, Message>>) -> Self
Adds a button or other element to the footer, which lines them up on the right. Add the main action last.
Sourcepub fn on_dismiss(self, message: Message) -> Self
pub fn on_dismiss(self, message: Message) -> Self
The message emitted when Escape, a click on the scrim or the close button dismisses the dialog. Without it, only the footer actions can close the dialog and the close button renders disabled.
Sourcepub fn dismiss_on_escape(self, dismiss: bool) -> Self
pub fn dismiss_on_escape(self, dismiss: bool) -> Self
Whether Escape dismisses the dialog. Defaults to true.
Sourcepub fn on_confirm(self, message: Message) -> Self
pub fn on_confirm(self, message: Message) -> Self
The message Action::Confirm (Enter) emits, usually the same as
the main footer action. Without it Enter does nothing. A field
inside the dialog that submits on Enter keeps the key.
Sourcepub fn dismiss_on_scrim(self, dismiss: bool) -> Self
pub fn dismiss_on_scrim(self, dismiss: bool) -> Self
Whether a click on the scrim dismisses the dialog. Defaults to
true; turn it off for confirmations that need an explicit answer.
Whether to show a close button in the top right corner. Defaults to
true.
Sourcepub fn id(self, id: impl Into<Id>) -> Self
pub fn id(self, id: impl Into<Id>) -> Self
Sets the surface’s widget id, which scopes focus. Give nested dialogs different ids.
Sourcepub fn pass_through(self, chords: impl IntoIterator<Item = Chord>) -> Self
pub fn pass_through(self, chords: impl IntoIterator<Item = Chord>) -> Self
Chords the open dialog lets through to the app, such as the shortcut that toggles it. Every other key press stops at the dialog.
pub fn is_open(&self) -> bool
Trait Implementations§
Source§impl<'a, Message: Clone + 'a> From<AlertDialog<'a, Message>> for Dialog<'a, Message>
impl<'a, Message: Clone + 'a> From<AlertDialog<'a, Message>> for Dialog<'a, Message>
Source§fn from(alert: AlertDialog<'a, Message>) -> Self
fn from(alert: AlertDialog<'a, Message>) -> Self
Auto Trait Implementations§
impl<'a, Message> !RefUnwindSafe for Dialog<'a, Message>
impl<'a, Message> !Send for Dialog<'a, Message>
impl<'a, Message> !Sync for Dialog<'a, Message>
impl<'a, Message> !UnwindSafe for Dialog<'a, Message>
impl<'a, Message> Freeze for Dialog<'a, Message>
impl<'a, Message> Unpin for Dialog<'a, Message>
impl<'a, Message> UnsafeUnpin for Dialog<'a, Message>where
Element<'a, Message, Theme, ()>: UnsafeUnpin,
Option<Element<'a, Message, Theme, ()>>: UnsafeUnpin,
Vec<Element<'a, Message, Theme, ()>>: UnsafeUnpin,
Option<Message>: UnsafeUnpin,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.