pub struct DialogFooter { /* private fields */ }Expand description
Standard dialog footer with right-aligned action buttons.
Renders a rule, then a row with optional left content and, on the right, the secondary
(outlined) button followed by the primary (filled) button. Shown directly in a
DialogFrame content Ui, the footer sits at the bottom of the frame.
§Example
let (ok, cancel) = DialogFooter::new("Ok")
.secondary("Cancel")
.show(ui);
if ok { /* apply */ }
if cancel { /* close */ }Implementations§
Sourcepub fn new(primary_label: impl Into<String>) -> Self
pub fn new(primary_label: impl Into<String>) -> Self
Create a footer with a primary action label.
Sourcepub fn primary_enabled(self, enabled: bool) -> Self
pub fn primary_enabled(self, enabled: bool) -> Self
Enable/disable the primary button.
Sourcepub fn danger(self) -> Self
pub fn danger(self) -> Self
Mark the primary action as destructive: it is filled with the danger colour.
Sourcepub fn show(self, ui: &mut Ui) -> (bool, bool)
pub fn show(self, ui: &mut Ui) -> (bool, bool)
Show the footer. Returns (primary_clicked, secondary_clicked).
Sourcepub fn show_with_left<R>(
self,
ui: &mut Ui,
left_content: impl FnOnce(&mut Ui) -> R,
) -> (bool, bool)
pub fn show_with_left<R>( self, ui: &mut Ui, left_content: impl FnOnce(&mut Ui) -> R, ) -> (bool, bool)
Show the footer with left-side content. Returns (primary_clicked, secondary_clicked).
Auto Trait Implementations§
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