pub struct Dialog { /* private fields */ }Expand description
Dialog component styled like shadcn/ui Dialog
§Example
use armas_basic::components::Dialog;
let mut dialog = Dialog::new("confirm")
.open(true)
.title("Are you sure?")
.description("This action cannot be undone.");
let response = dialog.show(ctx, theme, |ui| {
ui.label("Confirm to proceed.");
});
if response.closed {
// dialog was dismissed
}Implementations§
Source§impl Dialog
impl Dialog
Sourcepub const fn open(self, is_open: bool) -> Self
pub const fn open(self, is_open: bool) -> Self
Set the dialog to be open (for external control)
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set the dialog description
Sourcepub const fn size(self, size: DialogSize) -> Self
pub const fn size(self, size: DialogSize) -> Self
Set the dialog size
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dialog
impl RefUnwindSafe for Dialog
impl Send for Dialog
impl Sync for Dialog
impl Unpin for Dialog
impl UnsafeUnpin for Dialog
impl UnwindSafe for Dialog
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