diff options
Diffstat (limited to 'winit/src/conversion.rs')
-rw-r--r-- | winit/src/conversion.rs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs index a9262184..dcae7074 100644 --- a/winit/src/conversion.rs +++ b/winit/src/conversion.rs @@ -140,6 +140,19 @@ pub fn window_event( } } +/// Converts a [`window::Level`] to a [`winit`] window level. +/// +/// [`winit`]: https://github.com/rust-windowing/winit +pub fn window_level(level: window::Level) -> winit::window::WindowLevel { + match level { + window::Level::Normal => winit::window::WindowLevel::Normal, + window::Level::AlwaysOnBottom => { + winit::window::WindowLevel::AlwaysOnBottom + } + window::Level::AlwaysOnTop => winit::window::WindowLevel::AlwaysOnTop, + } +} + /// Converts a [`Position`] to a [`winit`] logical position for a given monitor. /// /// [`winit`]: https://github.com/rust-windowing/winit @@ -250,9 +263,7 @@ pub fn mouse_button(mouse_button: winit::event::MouseButton) -> mouse::Button { winit::event::MouseButton::Left => mouse::Button::Left, winit::event::MouseButton::Right => mouse::Button::Right, winit::event::MouseButton::Middle => mouse::Button::Middle, - winit::event::MouseButton::Other(other) => { - mouse::Button::Other(other as u8) - } + winit::event::MouseButton::Other(other) => mouse::Button::Other(other), } } |