pub struct ButtonState {
pub area: Rect,
pub inner: Rect,
pub hover_enabled: bool,
pub armed: bool,
pub armed_delay: Option<Duration>,
pub focus: FocusFlag,
pub mouse: MouseFlags,
pub non_exhaustive: NonExhaustive,
}Expand description
State & event-handling.
Fields§
§area: RectComplete area readonly. renewed for each render.
inner: RectArea inside the block. readonly. renewed for each render.
hover_enabled: boolHover is enabled?
armed: boolButton has been clicked but not released yet. used for mouse interaction
armed_delay: Option<Duration>Some terminals repaint too fast to see the click. This adds some delay when the button state goes from armed to clicked.
Default is 50ms.
focus: FocusFlagCurrent focus state. read+write
mouse: MouseFlags§non_exhaustive: NonExhaustiveImplementations§
Trait Implementations§
Source§impl Clone for ButtonState
impl Clone for ButtonState
Source§impl Debug for ButtonState
impl Debug for ButtonState
Source§impl Default for ButtonState
impl Default for ButtonState
Source§impl HandleEvent<Event, KeyEvent, ButtonOutcome> for ButtonState
Check event-handling for this hot-key and do Regular key-events otherwise.
impl HandleEvent<Event, KeyEvent, ButtonOutcome> for ButtonState
Check event-handling for this hot-key and do Regular key-events otherwise.
Source§impl HandleEvent<Event, MouseOnly, ButtonOutcome> for ButtonState
impl HandleEvent<Event, MouseOnly, ButtonOutcome> for ButtonState
Source§impl HandleEvent<Event, Regular, ButtonOutcome> for ButtonState
impl HandleEvent<Event, Regular, ButtonOutcome> for ButtonState
Source§impl HasFocus for ButtonState
impl HasFocus for ButtonState
Source§fn build(&self, builder: &mut FocusBuilder)
fn build(&self, builder: &mut FocusBuilder)
Build the focus-structure for the container.
Declares how the widget interacts with focus. Read more
Source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Focused?
Source§fn lost_focus(&self) -> bool
fn lost_focus(&self) -> bool
Just lost focus.
Source§fn gained_focus(&self) -> bool
fn gained_focus(&self) -> bool
Just gained focus.
Source§impl RelocatableState for ButtonState
impl RelocatableState 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