Browse Source

Support closing windows

master
Matt Baer 4 years ago
parent
commit
14ec2eb2a5
2 changed files with 10 additions and 0 deletions
  1. +4
    -0
      writeas/AppDelegate.swift
  2. +6
    -0
      writeas/Base.lproj/Main.storyboard

+ 4
- 0
writeas/AppDelegate.swift View File

@@ -69,6 +69,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}

@IBAction func fileClose(_ sender: Any) {
NSApplication.shared().mainWindow!.close()
}

@IBAction func toggleNightMode(_ sender: NSMenuItem) {
let isOff = sender.state == NSOffState



+ 6
- 0
writeas/Base.lproj/Main.storyboard View File

@@ -83,6 +83,12 @@
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
<menuItem title="Close" keyEquivalent="w" id="Jqh-E2-bP0">
<connections>
<action selector="fileClose:" target="Voe-Tx-rLC" id="wwH-Vr-YXS"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="qlM-x5-Aiq"/>
<menuItem title="Save" keyEquivalent="s" id="pxx-59-PXV">
<connections>
<action selector="saveDocument:" target="Voe-Tx-rLC" id="6F3-Jk-bXC"/>


Loading…
Cancel
Save