Implement conversion for `CursorIcon` in `winit`
This commit is contained in:
parent
cc6d5b8ec7
commit
6d248719f3
|
@ -14,5 +14,5 @@ pub enum Event {
|
|||
},
|
||||
|
||||
/// A unicode character was received.
|
||||
ReceivedCharacter(char),
|
||||
CharacterReceived(char),
|
||||
}
|
||||
|
|
|
@ -19,3 +19,17 @@ pub enum MouseCursor {
|
|||
/// The cursor is grabbing a widget.
|
||||
Grabbing,
|
||||
}
|
||||
|
||||
#[cfg(feature = "winit")]
|
||||
impl From<MouseCursor> for winit::window::CursorIcon {
|
||||
fn from(mouse_cursor: MouseCursor) -> winit::window::CursorIcon {
|
||||
match mouse_cursor {
|
||||
MouseCursor::OutOfBounds => winit::window::CursorIcon::Default,
|
||||
MouseCursor::Idle => winit::window::CursorIcon::Default,
|
||||
MouseCursor::Pointer => winit::window::CursorIcon::Hand,
|
||||
MouseCursor::Working => winit::window::CursorIcon::Progress,
|
||||
MouseCursor::Grab => winit::window::CursorIcon::Grab,
|
||||
MouseCursor::Grabbing => winit::window::CursorIcon::Grabbing,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue