Add Window::is_maximized method (#1804)

This commit is contained in:
Simas Toleikis 2021-01-27 20:01:17 +02:00 committed by GitHub
parent 05125029c6
commit 3f1e09ec0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 49 additions and 7 deletions

View file

@ -23,7 +23,6 @@ fn main() {
_ => panic!("Please enter a valid number"),
});
let mut is_maximized = false;
let mut decorations = true;
let window = WindowBuilder::new()
@ -59,8 +58,8 @@ fn main() {
println!("window.fullscreen {:?}", window.fullscreen());
}
(VirtualKeyCode::M, ElementState::Pressed) => {
is_maximized = !is_maximized;
window.set_maximized(is_maximized);
let is_maximized = window.is_maximized();
window.set_maximized(!is_maximized);
}
(VirtualKeyCode::D, ElementState::Pressed) => {
decorations = !decorations;