Repo // NSApplication.shared -> NSApp.
This commit is contained in:
parent
08148779e5
commit
939162e08a
|
@ -50,7 +50,7 @@ extension NSApplication {
|
|||
public static var isDarkMode: Bool {
|
||||
if #unavailable(macOS 10.14) { return false }
|
||||
if #available(macOS 10.15, *) {
|
||||
let appearanceDescription = NSApplication.shared.effectiveAppearance.debugDescription
|
||||
let appearanceDescription = NSApp.effectiveAppearance.debugDescription
|
||||
.lowercased()
|
||||
return appearanceDescription.contains("dark")
|
||||
} else if let appleInterfaceStyle = UserDefaults.standard.string(forKey: "AppleInterfaceStyle") {
|
||||
|
|
|
@ -67,7 +67,7 @@ public enum Uninstaller {
|
|||
if !FileManager.trashTargetIfExists(pathIMELibrary + kTargetBundle) { return -1 } // 最後移除 App 自身
|
||||
// 幹掉殘留在記憶體內的執行緒。
|
||||
if selfKill {
|
||||
NSApplication.shared.terminate(nil)
|
||||
NSApp.terminate(nil)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
|
|
@ -114,6 +114,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
|||
// New About Window
|
||||
@IBAction func about(_: Any) {
|
||||
CtlAboutWindow.show()
|
||||
NSApplication.shared.activate(ignoringOtherApps: true)
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ struct VwrPrefPaneDevZone: View {
|
|||
isOn: $selUseIMKCandidateWindow.onChange {
|
||||
PrefMgr.shared.useIMKCandidateWindow = selUseIMKCandidateWindow
|
||||
NSLog("vChewing App self-terminated due to enabling / disabling IMK candidate window.")
|
||||
NSApplication.shared.terminate(nil)
|
||||
NSApp.terminate(nil)
|
||||
}
|
||||
)
|
||||
Text(
|
||||
|
|
|
@ -88,7 +88,7 @@ struct VwrPrefPaneDictionary: View {
|
|||
PrefMgr.shared.userDataFolderSpecified = newPath
|
||||
tbxUserDataPathSpecified = PrefMgr.shared.userDataFolderSpecified
|
||||
BookmarkManager.shared.saveBookmark(for: url)
|
||||
(NSApplication.shared.delegate as! AppDelegate).updateDirectoryMonitorPath()
|
||||
(NSApp.delegate as! AppDelegate).updateDirectoryMonitorPath()
|
||||
} else {
|
||||
IMEApp.buzz()
|
||||
if !bolPreviousFolderValidity {
|
||||
|
|
|
@ -99,7 +99,7 @@ struct VwrPrefPaneGeneral: View {
|
|||
UserDefaults.standard.removeObject(forKey: UserDef.kAppleLanguages.rawValue)
|
||||
}
|
||||
NSLog("vChewing App self-terminated due to UI language change.")
|
||||
NSApplication.shared.terminate(nil)
|
||||
NSApp.terminate(nil)
|
||||
}
|
||||
) {
|
||||
Text(LocalizedStringKey("Follow OS settings")).tag(["auto"])
|
||||
|
|
|
@ -194,13 +194,13 @@ class CtlPrefWindow: NSWindowController {
|
|||
}
|
||||
|
||||
NSLog("vChewing App self-terminated due to UI language change.")
|
||||
NSApplication.shared.terminate(nil)
|
||||
NSApp.terminate(nil)
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func updateIMKCandidateEnableStatusAction(_: Any) {
|
||||
NSLog("vChewing App self-terminated due to enabling / disabling IMK candidate window.")
|
||||
NSApplication.shared.terminate(nil)
|
||||
NSApp.terminate(nil)
|
||||
}
|
||||
|
||||
@IBAction func clickedWhetherIMEShouldNotFartToggleAction(_: Any) {
|
||||
|
@ -260,7 +260,7 @@ class CtlPrefWindow: NSWindowController {
|
|||
if LMMgr.checkIfSpecifiedUserDataFolderValid(newPath) {
|
||||
PrefMgr.shared.userDataFolderSpecified = newPath
|
||||
BookmarkManager.shared.saveBookmark(for: url)
|
||||
(NSApplication.shared.delegate as! AppDelegate).updateDirectoryMonitorPath()
|
||||
(NSApp.delegate as! AppDelegate).updateDirectoryMonitorPath()
|
||||
} else {
|
||||
IMEApp.buzz()
|
||||
if !bolPreviousFolderValidity {
|
||||
|
|
|
@ -25,6 +25,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||
// Call the New About Window
|
||||
@IBAction func about(_: Any) {
|
||||
CtlAboutWindow.show()
|
||||
NSApplication.shared.activate(ignoringOtherApps: true)
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue