diff --git a/Stats/Views/Settings.swift b/Stats/Views/Settings.swift index 8b42d5aa..52714974 100644 --- a/Stats/Views/Settings.swift +++ b/Stats/Views/Settings.swift @@ -74,7 +74,7 @@ class SettingsWindow: NSWindow, NSWindowDelegate, NSToolbarDelegate { self.contentViewController = sidebarViewController self.titlebarAppearsTransparent = true self.backgroundColor = .clear - self.center() + self.positionCenter() self.setIsVisible(false) let windowController = NSWindowController() @@ -218,6 +218,13 @@ class SettingsWindow: NSWindow, NSWindowDelegate, NSToolbarDelegate { self.setIsVisible(true) } } + + private func positionCenter() { + self.setFrameOrigin(NSPoint( + x: (NSScreen.main!.frame.width - SettingsWindow.size.width)/2, + y: (NSScreen.main!.frame.height - SettingsWindow.size.height)/2 + )) + } } // MARK: - MainView