Window now always appears in the same location.
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user