pub struct Button<'a> { /* private fields */ }Expand description
Button widget.
Implementations§
Source§impl<'a> Button<'a>
impl<'a> Button<'a>
pub fn new(text: impl Into<Text<'a>>) -> Self
Sourcepub fn styles_opt(self, styles: Option<ButtonStyle>) -> Self
pub fn styles_opt(self, styles: Option<ButtonStyle>) -> Self
Set all styles.
Sourcepub fn styles(self, styles: ButtonStyle) -> Self
pub fn styles(self, styles: ButtonStyle) -> Self
Set all styles.
Sourcepub fn focus_style(self, style: impl Into<Style>) -> Self
pub fn focus_style(self, style: impl Into<Style>) -> Self
Style when focused.
Sourcepub fn armed_style(self, style: impl Into<Style>) -> Self
pub fn armed_style(self, style: impl Into<Style>) -> Self
Style when clicked but not released.
Sourcepub fn armed_delay(self, delay: Duration) -> Self
pub fn armed_delay(self, delay: Duration) -> Self
Some terminals repaint too fast to see the click. This adds some delay when the button state goes from armed to clicked.
Sourcepub fn hover_style(self, style: impl Into<Style>) -> Self
pub fn hover_style(self, style: impl Into<Style>) -> Self
Style for hover over the button.
Sourcepub fn left_aligned(self) -> Self
pub fn left_aligned(self) -> Self
Left align button text.
Sourcepub fn right_aligned(self) -> Self
pub fn right_aligned(self) -> Self
Right align button text.
Trait Implementations§
Source§impl StatefulWidget for Button<'_>
impl StatefulWidget for Button<'_>
Auto Trait Implementations§
impl<'a> Freeze for Button<'a>
impl<'a> RefUnwindSafe for Button<'a>
impl<'a> Send for Button<'a>
impl<'a> Sync for Button<'a>
impl<'a> Unpin for Button<'a>
impl<'a> UnwindSafe for Button<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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