Window now always appears in the same location.

This commit is contained in:
2025-01-11 19:16:02 -08:00
parent 606d2b1828
commit 9bc0dfc6f3

View File

@@ -253,10 +253,11 @@ class SearchViewController: NSViewController, NSTextFieldDelegate,
keyboardEvents?.start() keyboardEvents?.start()
// TODO: This doesn't play well when the window is expanded with if let win = view.window, let scrn = NSScreen.main {
// search results, causing it to reappear in a slightly let x = (scrn.visibleFrame.size.width / 2) - (win.frame.size.width / 2)
// above usual position. let y = (scrn.visibleFrame.size.height * 0.9) - win.frame.size.height
view.window?.center() view.window?.setFrameOrigin(NSPoint(x: x, y: y))
}
view.window?.makeFirstResponder(searchInput) view.window?.makeFirstResponder(searchInput)
// searchInput should select all text whenever window appears. // searchInput should select all text whenever window appears.