mirror of
https://github.com/qvacua/vimr.git
synced 2024-12-25 23:02:35 +03:00
GH-325 Refactor slightly
This commit is contained in:
parent
693552e17c
commit
b01cc7fff7
@ -75,14 +75,15 @@ class AppDelegateReducer {
|
||||
return mainWindow
|
||||
}
|
||||
|
||||
let refFrame = state.mainWindowTemplate.frame
|
||||
let frame = refFrame.offsetBy(dx: cascadeX, dy: -cascadeY)
|
||||
|
||||
mainWindow.frame = frame
|
||||
mainWindow.frame = self.frame(relativeTo: state.mainWindowTemplate.frame)
|
||||
|
||||
return mainWindow
|
||||
}
|
||||
|
||||
fileprivate func frame(relativeTo refFrame: CGRect) -> CGRect {
|
||||
return refFrame.offsetBy(dx: cascadeX, dy: -cascadeY)
|
||||
}
|
||||
|
||||
fileprivate func screen(containing point: CGPoint) -> NSScreen? {
|
||||
return NSScreen.screens()?
|
||||
.reduce(nil) { (result, screen) -> NSScreen? in screen.frame.contains(point) ? screen : result }
|
||||
|
Loading…
Reference in New Issue
Block a user