-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Enable Window Sizing #4942
Enable Window Sizing #4942
Conversation
That might be a bug because the root page always fills the window... Right, @hartez? Maybe we also need a min/max on the window? And maybe the option to set flags, like the nosizing and toolwindow... Maybe these are for separate PRs. Need to figure out the wiggle first. And yeah, macos should respect bounds too. I don't think I implemented it yet as the Windows wiggle put a stop to that. I'll get back to it as soon as p14 is out the door. |
After much playing around and learning about WinUI I see we now have a nice API that works well - trick is to use |
In winforms days we also had screen position this could be centered minimised and maximised in the more modern word be great if we could that and tell which montior to start a particular screen on ? |
Could you open an issue on the screens? I assume you would be looking to not only say screen 1 or 2 but also see what screens are available and their size? |
@mattleibow in which version of MAUI is this fix available in? When will it be public (my Maui.Controls.Window object doesn't contain Width, Height etc properties)? |
This arrives in .NET 7 Already available in RC2, soon in GA :) |
@Redth thanks! |
Right now the general solution for setting the window size of a maui application seems to be by calling .Resize on the AppWindow at window creation. This however, causes a "flicker" because it resizes after window creation. Will this have the same issue of flickering or will the window size be set properly before showing it? |
This marks #7592 as completed. Is restoring values also implemented? Every time I open my app on Windows, it shows up on my main screen with the same size, ignoring the location and size I used last session. |
Description of Change
Add the ability to set window size and read size and position.
Depends on:
Known Issues:
Platforms:
X\Y(not supported)Width\Height(not supported)Additions made
One notable difference in API is that the views have a Width/HeightRequest and then a Width/Height for the actual bounds. Window does not need this because no matter what the user sets, that is the value. And, if the user doe not set any value, the OS will assign one. You cannot have a window without bounds. Views have bounds too, but there is a layout system that interprets it. For example, a view can be set to fill a space in a Grid, and then when moved to a new cell, it resizes. Window is the opposite - the OS ensures that the size is set and nothing updates it unless the user resizes it.
Core:
Controls:
Usage:
NOTES
Mac Catalyst does not support window sizing or positioning, however sizing could happen via setting both the min and max sizes on the window. This will then trigger a resize and you can then reset back to mon=0 and max=maxvalue.
Not perfect, but works.
PR Checklist