-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVTablutionDelegate.swift
34 lines (29 loc) · 1.11 KB
/
VTablutionDelegate.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// VTablutionDelegate.swift
// tablution
//
// Created by Ian McCowan on 11/15/15.
//
//
import Foundation
@objc public class VTablutionDelegate: NSObject, NSApplicationDelegate {
var viewController: VTabController?
public func applicationDidFinishLaunching(notification: NSNotification) {
let defaultFont = NSFont.systemFontOfSize(12.0)
let defaultFontData: NSData = NSKeyedArchiver.archivedDataWithRootObject(defaultFont)
let appDefaults = [
"tabFont": defaultFontData
]
NSUserDefaults.standardUserDefaults().registerDefaults(appDefaults)
if let unwrappedViewController = viewController as VTabController? {
unwrappedViewController.view.needsDisplay = true
unwrappedViewController.tabView!.tabFont = defaultFont
}
}
@IBAction public func showFontMenu(sender: AnyObject?) {
let baseFontManager: NSFontManager = NSFontManager.sharedFontManager()
if let fontPanel = baseFontManager.fontPanel(true) as NSFontPanel? {
fontPanel.makeKeyAndOrderFront(sender)
}
}
}