Add missing i18n to native macOS receiver selector and refactor

This commit is contained in:
hensm
2019-05-15 13:38:11 +01:00
parent 474dbad1aa
commit e368c4d09c
13 changed files with 155 additions and 108 deletions

View File

@@ -1,14 +1,13 @@
import Cocoa
class AppDelegate: NSObject {
class AppDelegate : NSObject, NSApplicationDelegate {
var mainWindow: NSWindow?
var mainWindowController: NSWindowController?
var mainWindowViewController: ViewController?
}
extension AppDelegate: NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification) {
func applicationDidFinishLaunching (_ aNotification: Notification) {
let window = NSPanel(
contentRect: NSZeroRect
, styleMask: [
@@ -21,7 +20,7 @@ extension AppDelegate: NSApplicationDelegate {
, backing: .buffered
, defer: false)
window.title = "fx_cast"
window.titleVisibility = .hidden
window.orderFrontRegardless()
window.center()
@@ -39,13 +38,12 @@ extension AppDelegate: NSApplicationDelegate {
NSApp.activate(ignoringOtherApps: true)
}
func applicationDidResignActive(_ aNotification: Notification) {
func applicationDidResignActive (_ aNotification: Notification) {
self.mainWindow?.performClose(aNotification)
}
func applicationWillTerminate(_ aNotification: Notification) {}
func applicationShouldTerminateAfterLastWindowClosed(_ app: NSApplication) -> Bool {
func applicationShouldTerminateAfterLastWindowClosed (
_ app: NSApplication) -> Bool {
return true
}
}