Bläddra i källkod

Support closing windows

master
Matt Baer 6 år sedan
förälder
incheckning
14ec2eb2a5
2 ändrade filer med 10 tillägg och 0 borttagningar
  1. +4
    -0
      writeas/AppDelegate.swift
  2. +6
    -0
      writeas/Base.lproj/Main.storyboard

+ 4
- 0
writeas/AppDelegate.swift Visa fil

@@ -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 Visa fil

@@ -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"/>


Laddar…
Avbryt
Spara