Closed chbeer closed 5 months ago
NSPanel's have a lot of uses, but it doesn't fit for a settings window. A settings window is not auxiliary to the main window, it's just another window in your app.
Sorry to come back to this closed request, but I disagree with your opinion regarding NSPanel
for settings, and I can support my opinion with what Xcode does:
Others use NSWindow, true. In document based apps, using NSPanel
is, at least, a good idea because that way the document window can stay main window and the NSPanel can be auxiliary to it. That way the "current document" window isn't lost.
Apple has been inconsistent about this in the past, but I think the best reference point is SwiftUI.Settings
, which uses NSWindow, even when the app is a document-based app (DocumentGroup
).
In document based apps, using NSPanel is, at least, a good idea because that way the document window can stay main window and the NSPanel can be auxiliary to it. That way the "current document" window isn't lost.
Windows can be auxiliary without being NSPanel. However, it seems like we are currently not preventing this. Can you try out this: https://github.com/sindresorhus/Settings/pull/125
An NSPane is „A special kind of window that typically performs a function that is auxiliary to the main window.“ and therefore suited better for the use case.