Struct Dialog

Source
pub struct Dialog<'a, Message, Theme = Theme, Renderer = Renderer>
where Renderer: 'a + Renderer, Theme: 'a + Catalog,
{ /* private fields */ }
Expand description

A message dialog.

Only the content is required, buttons and the title are optional.

Implementations§

Source§

impl<'a, Message, Theme, Renderer> Dialog<'a, Message, Theme, Renderer>
where Renderer: 'a + Renderer + Renderer, Theme: 'a + Catalog, Message: 'a + Clone,

Source

pub fn new( is_open: bool, base: impl Into<Element<'a, Message, Theme, Renderer>>, content: impl Into<Element<'a, Message, Theme, Renderer>>, ) -> Self

Creates a new Dialog with the given base and dialog content.

Source

pub fn with_buttons( is_open: bool, base: impl Into<Element<'a, Message, Theme, Renderer>>, content: impl Into<Element<'a, Message, Theme, Renderer>>, buttons: Vec<Element<'a, Message, Theme, Renderer>>, ) -> Self

Creates a new Dialog with the given base, dialog content and buttons.

Source

pub fn title(self, title: impl Into<String>) -> Self

Sets the Dialog’s title.

Source

pub fn width(self, width: impl Into<Length>) -> Self

Sets the Dialog’s width.

Source

pub fn height(self, height: impl Into<Length>) -> Self

Sets the Dialog’s height.

Source

pub fn padding(self, padding: impl Into<Padding>) -> Self

Sets the Dialog’s padding.

Source

pub fn spacing(self, spacing: impl Into<Pixels>) -> Self

Sets the Dialog’s spacing.

Source

pub fn align_buttons(self, align: impl Into<Vertical>) -> Self

Sets the vertical alignment of the Dialog’s buttons.

Source

pub fn font(self, font: impl Into<Renderer::Font>) -> Self

Sets the Font of the Dialog’s title.

Source

pub fn push_button( self, button: impl Into<Element<'a, Message, Theme, Renderer>>, ) -> Self

Adds a button to the Dialog.

Source

pub fn push_button_maybe( self, button: Option<impl Into<Element<'a, Message, Theme, Renderer>>>, ) -> Self

Adds a button to the Dialog, if Some.

Source

pub fn extend_buttons( self, buttons: impl IntoIterator<Item = Element<'a, Message, Theme, Renderer>>, ) -> Self

Extends the Dialog with the given buttons.

Source

pub fn backdrop(self, color: impl Into<Color>) -> Self
where <Theme as Catalog>::Class<'a>: From<StyleFn<'a, Theme>>,

Sets the backdrop color of the Dialog.

Source

pub fn style(self, style: impl Fn(&Theme) -> Style + 'a) -> Self
where <Theme as Catalog>::Class<'a>: From<StyleFn<'a, Theme>>,

Sets the style of the Dialog.

Source

pub fn title_style(self, style: impl Fn(&Theme) -> Style + 'a) -> Self
where <Theme as Catalog>::Class<'a>: From<StyleFn<'a, Theme>>,

Sets the style of the Dialog’s title.

Source

pub fn container_style(self, style: impl Fn(&Theme) -> Style + 'a) -> Self
where <Theme as Catalog>::Class<'a>: From<StyleFn<'a, Theme>>,

Sets the style of the Dialog’s container.

Source

pub fn class(self, class: impl Into<<Theme as Catalog>::Class<'a>>) -> Self

Sets the style class of the Dialog.

Source

pub fn title_class( self, class: impl Into<<Theme as Catalog>::Class<'a>>, ) -> Self

Sets the style class of the Dialog’s title.

Source

pub fn container_class( self, class: impl Into<<Theme as Catalog>::Class<'a>>, ) -> Self

Sets the style class of the Dialog’s container.

Trait Implementations§

Source§

impl<'a, Message, Theme, Renderer> From<Dialog<'a, Message, Theme, Renderer>> for Element<'a, Message, Theme, Renderer>
where Renderer: 'a + Renderer + Renderer, Theme: 'a + Catalog, Message: 'a + Clone, <Theme as Catalog>::Class<'a>: From<StyleFn<'a, Theme>>,

Source§

fn from(dialog: Dialog<'a, Message, Theme, Renderer>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a, Message, Theme, Renderer> Freeze for Dialog<'a, Message, Theme, Renderer>
where <Theme as Catalog>::Class<'a>: Freeze, <Theme as Catalog>::Class<'a>: Freeze, <Theme as Catalog>::Class<'a>: Freeze, <Renderer as Renderer>::Font: Freeze,

§

impl<'a, Message, Theme = Theme, Renderer = ()> !RefUnwindSafe for Dialog<'a, Message, Theme, Renderer>

§

impl<'a, Message, Theme = Theme, Renderer = ()> !Send for Dialog<'a, Message, Theme, Renderer>

§

impl<'a, Message, Theme = Theme, Renderer = ()> !Sync for Dialog<'a, Message, Theme, Renderer>

§

impl<'a, Message, Theme, Renderer> Unpin for Dialog<'a, Message, Theme, Renderer>
where <Theme as Catalog>::Class<'a>: Unpin, <Theme as Catalog>::Class<'a>: Unpin, <Theme as Catalog>::Class<'a>: Unpin, <Renderer as Renderer>::Font: Unpin,

§

impl<'a, Message, Theme = Theme, Renderer = ()> !UnwindSafe for Dialog<'a, Message, Theme, Renderer>

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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.