fix: moved to the custom center function for settings window positioning (#1274)

This commit is contained in:
Serhiy Mytrovtsiy
2023-01-24 18:05:12 +01:00
parent e75bbb22b8
commit d3cc02c25f

View File

@@ -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