pub struct ActionableDialogWidget<const MAX_ACTIONS: usize = 3> {
pub dialog_type: DialogType,
pub title: String<24>,
pub message: String<64>,
pub actions: Vec<DialogAction, MAX_ACTIONS>,
pub selected_action: usize,
pub background_color: Rgb565,
pub border_color: Rgb565,
}Expand description
Self-contained actionable modal dialog.
Fields§
§dialog_type: DialogTypeDialog type icon and theme.
title: String<24>Dialog title.
message: String<64>Dialog message body.
actions: Vec<DialogAction, MAX_ACTIONS>Action buttons collection.
selected_action: usizeIndex of currently selected/focused action.
background_color: Rgb565Background card color.
border_color: Rgb565Border stroke color.
Implementations§
Source§impl<const MAX_ACTIONS: usize> ActionableDialogWidget<MAX_ACTIONS>
impl<const MAX_ACTIONS: usize> ActionableDialogWidget<MAX_ACTIONS>
Sourcepub fn new(title: &str, message: &str, dialog_type: DialogType) -> Self
pub fn new(title: &str, message: &str, dialog_type: DialogType) -> Self
Creates a new actionable dialog.
Sourcepub fn add_action(&mut self, action: DialogAction) -> Result<(), DialogError>
pub fn add_action(&mut self, action: DialogAction) -> Result<(), DialogError>
Adds an action button to the dialog.
Sourcepub fn select_next(&mut self)
pub fn select_next(&mut self)
Selects the next action button to the right.
Sourcepub fn select_prev(&mut self)
pub fn select_prev(&mut self)
Selects the previous action button to the left.
Sourcepub fn current_action_id(&self) -> Option<u16>
pub fn current_action_id(&self) -> Option<u16>
Gets the action ID of the currently selected button.
Trait Implementations§
Source§impl<const MAX_ACTIONS: usize> Clone for ActionableDialogWidget<MAX_ACTIONS>
impl<const MAX_ACTIONS: usize> Clone for ActionableDialogWidget<MAX_ACTIONS>
Source§fn clone(&self) -> ActionableDialogWidget<MAX_ACTIONS>
fn clone(&self) -> ActionableDialogWidget<MAX_ACTIONS>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<const MAX_ACTIONS: usize> Freeze for ActionableDialogWidget<MAX_ACTIONS>
impl<const MAX_ACTIONS: usize> RefUnwindSafe for ActionableDialogWidget<MAX_ACTIONS>
impl<const MAX_ACTIONS: usize> Send for ActionableDialogWidget<MAX_ACTIONS>
impl<const MAX_ACTIONS: usize> Sync for ActionableDialogWidget<MAX_ACTIONS>
impl<const MAX_ACTIONS: usize> Unpin for ActionableDialogWidget<MAX_ACTIONS>
impl<const MAX_ACTIONS: usize> UnsafeUnpin for ActionableDialogWidget<MAX_ACTIONS>
impl<const MAX_ACTIONS: usize> UnwindSafe for ActionableDialogWidget<MAX_ACTIONS>
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.