pub enum ButtonAction {
None,
Pressed(KeyModifiers),
LongPressed,
Clicked(KeyModifiers),
Released(KeyModifiers),
}
Expand description
Actions emitted by a button widget, including the key modifiers that were active when the action occurred.
The sequence of actions emitted by a button is as follows:
ButtonAction::Pressed
when the button is pressed.ButtonAction::LongPressed
when the button has been pressed for a long time.- This only occurs on platforms that support a native long press, e.g., mobile.
- Then, either one of the following, but not both:
ButtonAction::Clicked
when the mouse/finger is lifted up while over the button area.ButtonAction::Released
when the mouse/finger is lifted up while not over the button area.
Variants§
None
Pressed(KeyModifiers)
The button was pressed (a “down” event).
LongPressed
The button was pressed for a long time (only occurs on mobile platforms).
Clicked(KeyModifiers)
The button was clicked (an “up” event).
Released(KeyModifiers)
The button was released (an “up” event), but should not be considered clicked because the mouse/finger was not over the button area when released.
Trait Implementations§
Source§impl ActionDefaultRef for ButtonAction
impl ActionDefaultRef for ButtonAction
fn default_ref() -> &'static Self
Source§impl Clone for ButtonAction
impl Clone for ButtonAction
Source§fn clone(&self) -> ButtonAction
fn clone(&self) -> ButtonAction
Returns a copy 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 ButtonAction
impl Debug for ButtonAction
Auto Trait Implementations§
impl Freeze for ButtonAction
impl RefUnwindSafe for ButtonAction
impl Send for ButtonAction
impl Sync for ButtonAction
impl Unpin for ButtonAction
impl UnwindSafe for ButtonAction
Blanket Implementations§
Source§impl<T> ActionTrait for T
impl<T> ActionTrait for T
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