-
Notifications
You must be signed in to change notification settings - Fork 543
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
Ability to make windows start centered #4376
Comments
Thanks for the feature request. |
The linked discussion seems to have gotten about as far as I did. Afaik, it's not possible to get the monitor the window is on from winit to calculate the center with. Also, the discussion mentions that there aren't many use cases for this, but I'd like to add that my personal use case is that my window is very small and having it open in the top left corner of my screen is very annoying. I have currently resorted to restoring the position from last session, but I'd still like for this feature to be added. A simple |
I second that, MS XAML has Especially small windows on big screens are a problem. With smaller windows I need to drag them in the middle because that's where my comfortable focus point for interaction is, regarding eye/head movement. |
That was a tough act taking several hours, at least an idea of how this might be done. The dynamic |
@prof79 Thanks for sharing the example. Btw, since this might be a common use case, I was thinking maybe we could add an enum in the WindowPosition enum to have it centered. https://slint.dev/docs/rust/slint/enum.WindowPosition |
surprised this feature doesn't exist, was expecting a built-in property like would like to ask if there some progress on this one? |
This feature is currently not on our short-term roadmap. I guess since we can't add an enum value to WindowPosition we could add a (Note: Our roadmap is flexible and responsive to the needs of our users and customers. If this issue is a blocker for you, please let us know by email or chat. Share details about your project, and we'll consider prioritizing it or offering it as a service.) |
Btw I had made a helper crate 😁 |
@prof79 thank you for your example. |
@ogoffart Thanks, I took your advice and fixed that. Also got my first PR on the example repo, so working/tested version for macOS now, too 🙂 |
XAML's |
It seems like it is not possible to make a window start in the center of the screen it launches on. I have found it's possible to set the position of the window before showing it, which, in combination with the size of the screen and of the window, can be used to make it start at the center, except it appears to be impossible to find out the size of the screen that the window will be shown on, hence it seems to be impossible to make it start centred.
Thus, I would like to request a feature to do this.
The text was updated successfully, but these errors were encountered: