desktop: Make F11 toggle fullscreen instead of just entering

This allows you to leave fullscreen the same you enter it.
This commit is contained in:
sleepycatcoding 2024-08-21 15:56:44 +03:00 committed by TÖRÖK Attila
parent eb3dec3d5d
commit d8b4ec0404
1 changed files with 2 additions and 1 deletions

View File

@ -66,7 +66,8 @@ impl MenuBar {
}
if egui_ctx.input_mut(|input| input.consume_shortcut(&Self::SHORTCUT_FULLSCREEN)) {
if let Some(player) = &mut player {
player.set_fullscreen(true);
let is_fullscreen = player.is_fullscreen();
player.set_fullscreen(!is_fullscreen);
}
}
}