Skip to content
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

Merged
merged 1 commit into from
Dec 4, 2020
Merged

Allow windows to be maximized. #1004

merged 1 commit into from
Dec 4, 2020

Conversation

frewsxcv
Copy link
Contributor

@frewsxcv frewsxcv commented Dec 4, 2020

Adds a new set_maximized method to allow users to maximize windows.

@@ -37,6 +37,7 @@ pub struct Window {
id: WindowId,
width: u32,
height: u32,
maximized: bool,
Copy link
Member

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) {
Copy link
Member

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.

@frewsxcv frewsxcv changed the title Allow windows to be created maximized. Allow windows to be maximized. Dec 4, 2020
@frewsxcv
Copy link
Contributor Author

frewsxcv commented Dec 4, 2020

@cart Feedback has been addressed

@frewsxcv frewsxcv requested a review from cart December 4, 2020 19:39
@cart
Copy link
Member

cart commented Dec 4, 2020

Awesome! Just fix the formatting issue (either manually or by running cargo +nightly fmt --all) and we're good to go!

Adds a new `set_maximized` method to allow users to maximize windows.
@frewsxcv
Copy link
Contributor Author

frewsxcv commented Dec 4, 2020

Done

@Moxinilian Moxinilian added C-Enhancement A new feature A-Windowing Platform-agnostic interface layer to run your app in labels Dec 4, 2020
@cart cart merged commit 1398d78 into bevyengine:master Dec 4, 2020
@fopsdev fopsdev mentioned this pull request Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Enhancement A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants