Move winit conversions to iced_winit
This commit is contained in:
parent
a92a0b73ed
commit
fb8b50ab79
7 changed files with 201 additions and 225 deletions
|
|
@ -1,9 +1,4 @@
|
|||
/// The state of a button.
|
||||
///
|
||||
/// If you are using [`winit`], consider enabling the `winit` feature to get
|
||||
/// conversion implementations for free!
|
||||
///
|
||||
/// [`winit`]: https://docs.rs/winit/0.20.0-alpha3/winit/
|
||||
#[derive(Debug, Hash, Ord, PartialOrd, PartialEq, Eq, Clone, Copy)]
|
||||
pub enum ButtonState {
|
||||
/// The button is pressed.
|
||||
|
|
@ -12,13 +7,3 @@ pub enum ButtonState {
|
|||
/// The button is __not__ pressed.
|
||||
Released,
|
||||
}
|
||||
|
||||
#[cfg(feature = "winit")]
|
||||
impl From<winit::event::ElementState> for ButtonState {
|
||||
fn from(element_state: winit::event::ElementState) -> Self {
|
||||
match element_state {
|
||||
winit::event::ElementState::Pressed => ButtonState::Pressed,
|
||||
winit::event::ElementState::Released => ButtonState::Released,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue