pub struct ConfirmDialog { /* private fields */ }Expand description
A confirmation dialog
Implementations§
Source§impl ConfirmDialog
impl ConfirmDialog
Sourcepub fn new(
id: impl Hash + Debug,
title: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn new( id: impl Hash + Debug, title: impl Into<String>, message: impl Into<String>, ) -> Self
Create a new confirm dialog
Sourcepub fn confirm_text(self, text: impl Into<String>) -> Self
pub fn confirm_text(self, text: impl Into<String>) -> Self
Set the confirm button text
Sourcepub fn cancel_text(self, text: impl Into<String>) -> Self
pub fn cancel_text(self, text: impl Into<String>) -> Self
Set the cancel button text
Sourcepub fn danger(self) -> Self
pub fn danger(self) -> Self
Mark this as a dangerous action (confirm button in the danger colour)
Sourcepub fn show(self, ctx: &Context, open: &mut bool) -> ConfirmResult
pub fn show(self, ctx: &Context, open: &mut bool) -> ConfirmResult
Show the confirm dialog
Returns the result of the dialog interaction. Escape, the close button and a click on the backdrop cancel.
Auto Trait Implementations§
impl Freeze for ConfirmDialog
impl RefUnwindSafe for ConfirmDialog
impl Send for ConfirmDialog
impl Sync for ConfirmDialog
impl Unpin for ConfirmDialog
impl UnsafeUnpin for ConfirmDialog
impl UnwindSafe for ConfirmDialog
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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