minor fix

This commit is contained in:
True Zhuanjia committed 2026-04-29 00:07:44 +08:00
1 parent 363b91b244
commit 8f5d58a25c
1 file changed
+24 -26
+24 -26
View File
@@ -542,21 +542,19 @@ import UIKit
@objc static private(set) var squeezeStartShortcut:String = "" @objc static private(set) var squeezeStartShortcut:String = ""
@objc static private(set) var squeezeEndShortcut:String = "" @objc static private(set) var squeezeEndShortcut:String = ""
@available(iOS 13.0, *)
@objc static public func enterSqueezeShortcuts(in viewController: UIViewController){ @objc static public func enterSqueezeShortcuts(in viewController: UIViewController){
if #available(iOS 13.0, *) {
let pickerViewController = WidgetPickerViewController() let pickerViewController = WidgetPickerViewController()
pickerViewController.delegate = (viewController as! any WidgetPickerViewControllerDelegate) pickerViewController.delegate = (viewController as! any WidgetPickerViewControllerDelegate)
pickerViewController.keyboardPickerMode = .shortcutPicker pickerViewController.keyboardPickerMode = .shortcutPicker
pickerViewController.tabIdentifiers = ["keyboard"] pickerViewController.tabIdentifiers = ["keyboard"]
pickerViewController.initialTabIdentifier = "keyboard" pickerViewController.initialTabIdentifier = "keyboard"
pickerViewController.shortcutIdentifier = "squeezePress" pickerViewController.shortcutIdentifier = "squeezePress"
pickerViewController.shortcutPickerTipText = SwiftLocalizationHelper.localizedString(forKey: "squeezePressShortcutPickerTip") pickerViewController.shortcutPickerTipText = SwiftLocalizationHelper.localizedString(forKey: "squeezePressShortcutPickerTip")
let nav = UINavigationController(rootViewController: pickerViewController) let nav = UINavigationController(rootViewController: pickerViewController)
nav.modalPresentationStyle = .overFullScreen nav.modalPresentationStyle = .overFullScreen
viewController.present(nav, animated: true) viewController.present(nav, animated: true)
return }
/* /*
let oscProfileMan = OSCProfilesManager.sharedManager(CGRectZero) let oscProfileMan = OSCProfilesManager.sharedManager(CGRectZero)
selectedProfile = oscProfileMan.getSelectedProfile() selectedProfile = oscProfileMan.getSelectedProfile()
@@ -597,19 +595,19 @@ import UIKit
*/ */
} }
@available(iOS 13.0, *)
@objc static public func enterSqueezeEndShortcut(in viewController: UIViewController){ @objc static public func enterSqueezeEndShortcut(in viewController: UIViewController){
let pickerViewController = WidgetPickerViewController() if #available(iOS 13.0, *) {
pickerViewController.delegate = (viewController as! any WidgetPickerViewControllerDelegate) let pickerViewController = WidgetPickerViewController()
pickerViewController.keyboardPickerMode = .shortcutPicker pickerViewController.delegate = (viewController as! any WidgetPickerViewControllerDelegate)
pickerViewController.tabIdentifiers = ["keyboard"] pickerViewController.keyboardPickerMode = .shortcutPicker
pickerViewController.initialTabIdentifier = "keyboard" pickerViewController.tabIdentifiers = ["keyboard"]
pickerViewController.shortcutIdentifier = "squeezeRelease" pickerViewController.initialTabIdentifier = "keyboard"
pickerViewController.shortcutPickerTipText = SwiftLocalizationHelper.localizedString(forKey: "squeezeReleaseShortcutPickerTip") pickerViewController.shortcutIdentifier = "squeezeRelease"
let nav = UINavigationController(rootViewController: pickerViewController) pickerViewController.shortcutPickerTipText = SwiftLocalizationHelper.localizedString(forKey: "squeezeReleaseShortcutPickerTip")
nav.modalPresentationStyle = .overFullScreen let nav = UINavigationController(rootViewController: pickerViewController)
viewController.present(nav, animated: true) nav.modalPresentationStyle = .overFullScreen
return viewController.present(nav, animated: true)
}
/* /*
let alert = UIAlertController(title: SwiftLocalizationHelper.localizedString(forKey: "Squeeze Shortcut"), let alert = UIAlertController(title: SwiftLocalizationHelper.localizedString(forKey: "Squeeze Shortcut"),