Skip to main content

SimpleDialogOption

Struct SimpleDialogOption 

Source
pub struct SimpleDialogOption<Msg = Callback> { /* private fields */ }
Expand description

One row of a SimpleDialog: a full-width option that answers the question by being chosen.

It is a widget of its own rather than a closure argument for the reason the reference makes it one — the row is the tappable thing, and its ink has to run the full width of the dialog, which only a widget that is the row can do.

Implementations§

Source§

impl<Msg: Clone + 'static> SimpleDialogOption<Msg>

Source

pub fn new(label: impl Into<String>, message: Msg) -> Self

An option showing label, sending message when it is chosen.

Source

pub fn with_child(child: impl Widget<Msg> + 'static) -> Self

The same, with a widget in place of the text.

Source

pub fn on_press(self, message: impl Into<Msg>) -> Self

What choosing it sends. Without one it cannot be chosen, which is the reference’s null onPressed.

Source

pub fn padding(self, padding: Insets) -> Self

The space around the row’s content. 8 down and 24 across by default.

Source

pub fn build(self) -> Box<dyn Widget<Msg>>

Assembles the option.

Auto Trait Implementations§

§

impl<Msg = Callback> !RefUnwindSafe for SimpleDialogOption<Msg>

§

impl<Msg = Callback> !Send for SimpleDialogOption<Msg>

§

impl<Msg = Callback> !Sync for SimpleDialogOption<Msg>

§

impl<Msg = Callback> !UnwindSafe for SimpleDialogOption<Msg>

§

impl<Msg> Freeze for SimpleDialogOption<Msg>
where Option<Box<dyn Widget<Msg>>>: Freeze, Option<Msg>: Freeze,

§

impl<Msg> Unpin for SimpleDialogOption<Msg>
where Option<Box<dyn Widget<Msg>>>: Unpin, Option<Msg>: Unpin,

§

impl<Msg> UnsafeUnpin for SimpleDialogOption<Msg>
where Option<Box<dyn Widget<Msg>>>: UnsafeUnpin, Option<Msg>: UnsafeUnpin,

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> 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<Msg> IntoMsg<Msg> for Msg

Source§

fn defer(work: impl Fn() -> Msg + 'static) -> Msg

The message that stands for work’s result.
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.