From b8ba716f342f7d13e1293ee7dd5c8bca02863866 Mon Sep 17 00:00:00 2001 From: Acaki Date: Thu, 7 Aug 2025 00:34:07 +0800 Subject: [PATCH] feat: add and option to toggle stats and graphs temporaily in toolbox --- VoidLink/Localization/Localizable.xcstrings | 23 +++++++++++++++++++ .../ToolboxViewController.swift | 8 +++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/VoidLink/Localization/Localizable.xcstrings b/VoidLink/Localization/Localizable.xcstrings index 7c90308f..1a2b2f5b 100644 --- a/VoidLink/Localization/Localizable.xcstrings +++ b/VoidLink/Localization/Localizable.xcstrings @@ -283,6 +283,29 @@ } } }, + "[ Toggle stats overlay & graphs ]" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "[ 切换统计覆盖层和图表 ]" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "[ 切換統計覆蓋層和圖表 ]" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "[ 切換統計覆蓋層和圖表 ]" + } + } + } + }, "[ On-screen widget tool ]" : { "extractionState" : "manual", "localizations" : { diff --git a/VoidLink/ViewControllers/ToolboxViewController.swift b/VoidLink/ViewControllers/ToolboxViewController.swift index 5d446728..4823c99f 100644 --- a/VoidLink/ViewControllers/ToolboxViewController.swift +++ b/VoidLink/ViewControllers/ToolboxViewController.swift @@ -13,6 +13,7 @@ import UIKit @objc optional func switchWidgetProfile() @objc optional func bringUpSoftKeyboard() @objc optional func enterPip() + @objc optional func toggleStatsOverlay() } @@ -28,12 +29,13 @@ import UIKit private let viewBackgroundColor = UIColor(white: 0.2, alpha: 0.8); private let highlightColor = UIColor(white: 0.39, alpha: 0.8); private let titleLabel = UILabel() - @objc public var specialEntries : NSMutableArray = ["widgetSwitchTool", "widgetLayoutTool", "bringUpSoftKeyboard", "enterPip"] + @objc public var specialEntries : NSMutableArray = ["widgetSwitchTool", "widgetLayoutTool", "bringUpSoftKeyboard", "enterPip", "toggleStatsOverlay"] private let specialEntryAliasDic : [String:String] = [ "widgetSwitchTool":SwiftLocalizationHelper.localizedString(forKey: "[ Switch on-screen widget profile ]"), "widgetLayoutTool":SwiftLocalizationHelper.localizedString(forKey: "[ On-screen widget tool ]"), "bringUpSoftKeyboard":SwiftLocalizationHelper.localizedString(forKey: "[ Bring up soft keyboard ]"), - "enterPip":SwiftLocalizationHelper.localizedString(forKey: "[ Enter picture-in-picture mode ]") + "enterPip":SwiftLocalizationHelper.localizedString(forKey: "[ Enter picture-in-picture mode ]"), + "toggleStatsOverlay":SwiftLocalizationHelper.localizedString(forKey: "[ Toggle stats overlay & graphs ]") ] private var viewPinned: Bool = false @@ -377,6 +379,8 @@ import UIKit specialEntryDelegate?.bringUpSoftKeyboard?() case "enterPip": specialEntryDelegate?.enterPip?() + case "toggleStatsOverlay": + specialEntryDelegate?.toggleStatsOverlay?() default: break } }