End editing when prefs window is closed.

This commit is contained in:
Damiano Galassi committed 2018-03-15 15:48:20 +01:00
1 parent 18fecbfc68
commit 370e64b252
3 files changed
+46 -1

No files matched your search

+5 -1
View File
@@ -7,7 +7,7 @@
import Cocoa
class PrefsWindowController: NSWindowController {
class PrefsWindowController: NSWindowController, NSWindowDelegate {
public class func registerUserDefaults() {
let defaults = UserDefaults.standard
@@ -108,6 +108,10 @@ class PrefsWindowController: NSWindowController {
}
}
func windowWillClose(_ notification: Notification) {
_ = self.window?.endEditing()
}
lazy var generalController: GeneralPrefsViewController = { return GeneralPrefsViewController() }()
lazy var metadataController: MetadataPrefsViewController = { return MetadataPrefsViewController() }()
lazy var presetController: PresetPrefsViewController = { return PresetPrefsViewController() }()