-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows & X11: Window::set_resizable (#558)
* Windows: Window::set_resizable * X11: Window::set_resizable * Code style regarding resizable * X11: set_resizable remember max/min window size * Stub out set_resizable on Android, iOS, and emscripten * remove comment block from docs * Windows: set_resizable in fullscreen * Special case Xfwm * Added fun provisos to docs
- Loading branch information
1 parent
2b4b64f
commit be5a2b0
Showing
11 changed files
with
155 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
extern crate winit; | ||
|
||
fn main() { | ||
let mut events_loop = winit::EventsLoop::new(); | ||
|
||
let mut resizable = false; | ||
|
||
let window = winit::WindowBuilder::new() | ||
.with_title("Hit space to toggle resizability.") | ||
.with_dimensions(400, 200) | ||
.with_resizable(resizable) | ||
.build(&events_loop) | ||
.unwrap(); | ||
|
||
events_loop.run_forever(|event| { | ||
match event { | ||
winit::Event::WindowEvent { event, .. } => match event { | ||
winit::WindowEvent::CloseRequested => return winit::ControlFlow::Break, | ||
winit::WindowEvent::KeyboardInput { | ||
input: | ||
winit::KeyboardInput { | ||
virtual_keycode: Some(winit::VirtualKeyCode::Space), | ||
state: winit::ElementState::Released, | ||
.. | ||
}, | ||
.. | ||
} => { | ||
resizable = !resizable; | ||
println!("Resizable: {}", resizable); | ||
window.set_resizable(resizable); | ||
} | ||
_ => (), | ||
}, | ||
_ => (), | ||
}; | ||
winit::ControlFlow::Continue | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters