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
49 stars 9 forks source link

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

Closed matthew-carroll closed 11 months ago

matthew-carroll commented 12 months 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 12 months ago

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

Adrian-Samoticha commented 11 months 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 11 months ago

Excuse the delay. This feature is now impelemted.