macosui / macos_window_utils.dart

macos_window_utils is a Flutter package that provides a set of methods for modifying the NSWindow of a Flutter application on macOS.
https://pub.dev/packages/macos_window_utils
MIT License
52 stars 9 forks source link

Make it possible to center the window on the screen #37

Closed matthew-carroll closed 1 year ago

matthew-carroll commented 1 year ago

Is there currently a set of APIs that makes it possible to set the size of the window and place it at the center of the screen?

If not, it would be great to have those APIs. I'm trying to control the initial launch of the app to center a window of a particular window size.

Adrian-Samoticha commented 1 year ago

There currently is not, but implementing such functionality shouldn’t be too difficult.

Adrian-Samoticha commented 1 year ago

Apparently, NSWindow has a center method which does exactly that, however, I’d argue that it’d be best to go all the way and offer methods to modify the window’s frame, thus allowing the window to be placed at arbitrary positions.

Adrian-Samoticha commented 1 year ago

Excuse the delay. This feature is now impelemted.