Introduce window::Level enum

... and add `level` field to `window::Settings`
This commit is contained in:
Héctor Ramón Jiménez 2023-05-25 23:14:07 +02:00
parent b924e86630
commit a7fa7e4005
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
5 changed files with 46 additions and 16 deletions

View file

@ -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