ctlIME // Optimize showPreferences().
This commit is contained in:
parent
b4d0ced002
commit
ada09f758a
|
@ -188,17 +188,13 @@ extension ctlInputMethod {
|
||||||
if #available(macOS 10.15, *) {
|
if #available(macOS 10.15, *) {
|
||||||
NSApp.setActivationPolicy(.accessory)
|
NSApp.setActivationPolicy(.accessory)
|
||||||
ctlPrefUI.shared.controller.show(preferencePane: Preferences.PaneIdentifier(rawValue: "General"))
|
ctlPrefUI.shared.controller.show(preferencePane: Preferences.PaneIdentifier(rawValue: "General"))
|
||||||
ctlPrefUI.shared.controller.window?.level = .floating
|
ctlPrefUI.shared.controller.window?.level = .statusBar
|
||||||
} else {
|
} else {
|
||||||
showPrefWindowTraditional()
|
showLegacyPreferences()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func showLegacyPreferences(_: Any?) {
|
@objc func showLegacyPreferences(_: Any? = nil) {
|
||||||
showPrefWindowTraditional()
|
|
||||||
}
|
|
||||||
|
|
||||||
private func showPrefWindowTraditional() {
|
|
||||||
(NSApp.delegate as? AppDelegate)?.showPreferences()
|
(NSApp.delegate as? AppDelegate)?.showPreferences()
|
||||||
NSApp.activate(ignoringOtherApps: true)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue