more functional buttons

This commit is contained in:
True Zhuanjia
2026-04-10 21:34:14 +08:00
parent 732ec9a9cd
commit 8fd43d47dd
3 changed files with 182 additions and 2 deletions
+9
View File
@@ -49,6 +49,9 @@ import ObjectiveC.runtime
@objc public weak var functionalButtonDelegate: OnScreenFunctionalButtonDelegate?
@objc protocol OnScreenFunctionalButtonDelegate: AnyObject {
func expandSettingsView()
func disconnectRemoteSession()
func disconnectAndQuitApp()
func enterPip()
func bringUpToolboxMenu()
func openWidgetLayoutTool()
func openWidgetProfileTable(pickProfile: Bool)
@@ -2516,8 +2519,14 @@ import ObjectiveC.runtime
DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
self.functionalButtonDelegate?.expandSettingsView()
}
case "DISCONNECT":
self.functionalButtonDelegate?.disconnectRemoteSession()
case "QUITAPP":
self.functionalButtonDelegate?.disconnectAndQuitApp()
case "TOOLBOX":
self.functionalButtonDelegate?.bringUpToolboxMenu()
case "PIP":
self.functionalButtonDelegate?.enterPip()
case "WIDGETTOOL":
temporaryDisableFolderButtonAnimation()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
+139 -1
View File
@@ -675,6 +675,29 @@
}
}
},
"=Folder" : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "控件夹"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "控制項夾"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "控制項夾"
}
}
}
},
"=GamepadOverlayOff" : {
"extractionState" : "manual",
"localizations" : {
@@ -3483,6 +3506,52 @@
}
}
},
"Disconnect and quit current app" : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "断开并退出当前应用"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "斷開並退出目前應用程式"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "斷開並退出目前應用程式"
}
}
}
},
"Disconnect current connection" : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "断开当前连接"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "斷開目前連線"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "斷開目前連線"
}
}
}
},
"Displacement-based right stick pad" : {
"extractionState" : "manual",
"localizations" : {
@@ -3846,7 +3915,7 @@
}
}
},
"Edit Layout" : {
"Edit layout" : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
@@ -4117,6 +4186,52 @@
}
}
},
"Enter picture-in-picture mode" : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "进入画中画模式"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "進入子母畫面模式"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "進入子母畫面模式"
}
}
}
},
"Enter PiP" : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "画中画"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "子母畫面"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "子母畫面"
}
}
}
},
"Enter the command & alias label" : {
"extractionState" : "manual",
"localizations" : {
@@ -8954,6 +9069,29 @@
}
}
},
"Quit app" : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "退出应用"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "退出應用程式"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "退出應用程式"
}
}
}
},
"Quit App" : {
"extractionState" : "manual",
"localizations" : {
+34 -1
View File
@@ -357,6 +357,36 @@ struct WidgetPickerView: View {
allowsShortcutCombo: false,
forcedComboMode: nil
),
FunctionalButtonOption(
label: SwiftLocalizationHelper.localizedString(forKey: "Disconnect"),
cmd: "DISCONNECT",
tip: SwiftLocalizationHelper.localizedString(forKey: "Disconnect current connection"),
allowsKeyboardCombination: false,
allowsGamepadCombination: false,
allowsSkillCombo: false,
allowsShortcutCombo: false,
forcedComboMode: nil
),
FunctionalButtonOption(
label: SwiftLocalizationHelper.localizedString(forKey: "Quit app"),
cmd: "QUITAPP",
tip: SwiftLocalizationHelper.localizedString(forKey: "Disconnect and quit current app"),
allowsKeyboardCombination: false,
allowsGamepadCombination: false,
allowsSkillCombo: false,
allowsShortcutCombo: false,
forcedComboMode: nil
),
FunctionalButtonOption(
label: SwiftLocalizationHelper.localizedString(forKey: "Enter PiP"),
cmd: "PIP",
tip: SwiftLocalizationHelper.localizedString(forKey: "Enter picture-in-picture mode"),
allowsKeyboardCombination: false,
allowsGamepadCombination: false,
allowsSkillCombo: false,
allowsShortcutCombo: false,
forcedComboMode: nil
),
FunctionalButtonOption(
label: SwiftLocalizationHelper.localizedString(forKey: "Folder"),
cmd: "FOLDER",
@@ -378,7 +408,7 @@ struct WidgetPickerView: View {
forcedComboMode: nil
),
FunctionalButtonOption(
label: SwiftLocalizationHelper.localizedString(forKey: "Edit Layout"),
label: SwiftLocalizationHelper.localizedString(forKey: "Edit layout"),
cmd: "WIDGETTOOL",
tip: SwiftLocalizationHelper.localizedString(forKey: "Open on-screen widget layout tool"),
allowsKeyboardCombination: false,
@@ -1745,6 +1775,9 @@ struct WidgetPickerView: View {
let initialButtonLabel,
targetWidgetKind == .button {
widgetButtonLabel = initialButtonLabel
} else if targetWidgetKind == .button,
let selectedFunctionalButtonOption {
widgetButtonLabel = selectedFunctionalButtonOption.cmd == "FOLDER" ? SwiftLocalizationHelper.localizedString(forKey: "=Folder") : selectedFunctionalButtonOption.label
} else {
widgetButtonLabel = ""
}