-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow windows to be maximized. #1004
Conversation
crates/bevy_window/src/window.rs
Outdated
@@ -37,6 +37,7 @@ pub struct Window { | |||
id: WindowId, | |||
width: u32, | |||
height: u32, | |||
maximized: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This state will be hard to keep "up to date" because users can resize the window. Additionally, maximizing isn't supported on some platforms (android, ios, web), but this would happily report it as maximized. I think (for now) we should probably just drop it to avoid mis-reporting the state.
pub fn maximized(&self) -> bool { | ||
self.maximized | ||
} | ||
|
||
pub fn set_resolution(&mut self, width: u32, height: u32) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a set_maximized(&mut self, maximized: bool)
function that produces a WindowCommand? It would be nice to let people maximize on-demand.
@cart Feedback has been addressed |
Awesome! Just fix the formatting issue (either manually or by running |
Adds a new `set_maximized` method to allow users to maximize windows.
Done |
Adds a new
set_maximized
method to allow users to maximize windows.