From ada09f758aead3eca6c3e632325b12581bbaade3 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Thu, 25 Aug 2022 19:23:35 +0800 Subject: [PATCH] ctlIME // Optimize showPreferences(). --- .../ControllerModules/ctlInputMethod_Menu.swift | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift b/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift index 66ba5629..c6fabfe7 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift @@ -188,17 +188,13 @@ extension ctlInputMethod { if #available(macOS 10.15, *) { NSApp.setActivationPolicy(.accessory) ctlPrefUI.shared.controller.show(preferencePane: Preferences.PaneIdentifier(rawValue: "General")) - ctlPrefUI.shared.controller.window?.level = .floating + ctlPrefUI.shared.controller.window?.level = .statusBar } else { - showPrefWindowTraditional() + showLegacyPreferences() } } - @objc func showLegacyPreferences(_: Any?) { - showPrefWindowTraditional() - } - - private func showPrefWindowTraditional() { + @objc func showLegacyPreferences(_: Any? = nil) { (NSApp.delegate as? AppDelegate)?.showPreferences() NSApp.activate(ignoringOtherApps: true) }