pub struct ButtonState {
pub focused: bool,
pub pressed: bool,
pub enabled: bool,
pub toggled: bool,
}Expand description
State for a button.
Fields§
§focused: boolWhether the button has focus.
pressed: boolWhether the button is currently pressed.
enabled: boolWhether the button is enabled.
toggled: boolFor toggle buttons: whether the button is toggled on.
Implementations§
Source§impl ButtonState
impl ButtonState
Sourcepub fn set_focused(&mut self, focused: bool)
pub fn set_focused(&mut self, focused: bool)
Set the focus state.
Sourcepub fn set_pressed(&mut self, pressed: bool)
pub fn set_pressed(&mut self, pressed: bool)
Set the pressed state.
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Set the enabled state.
Trait Implementations§
Source§impl Clone for ButtonState
impl Clone for ButtonState
Source§fn clone(&self) -> ButtonState
fn clone(&self) -> ButtonState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ButtonState
impl Debug for ButtonState
Auto Trait Implementations§
impl Freeze for ButtonState
impl RefUnwindSafe for ButtonState
impl Send for ButtonState
impl Sync for ButtonState
impl Unpin for ButtonState
impl UnwindSafe for ButtonState
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