mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-15 00:34:08 +09:00
fix: moved to the custom center function for settings window positioning (#1274)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user