use Mode::Hidden instead

This commit is contained in:
Cory Forsstrom 2021-04-09 09:00:29 -07:00
parent 6f6f1d82e8
commit 84c0c9bc7a
8 changed files with 19 additions and 35 deletions

View file

@ -141,13 +141,21 @@ pub fn fullscreen(
mode: Mode,
) -> Option<winit::window::Fullscreen> {
match mode {
Mode::Windowed => None,
Mode::Windowed | Mode::Hidden => None,
Mode::Fullscreen => {
Some(winit::window::Fullscreen::Borderless(monitor))
}
}
}
/// Converts a [`Mode`] to a visibility flag.
pub fn visible(mode: Mode) -> bool {
match mode {
Mode::Windowed | Mode::Fullscreen => true,
Mode::Hidden => false,
}
}
/// Converts a `MouseCursor` from [`iced_native`] to a [`winit`] cursor icon.
///
/// [`winit`]: https://github.com/rust-windowing/winit