From c08bb232cdd1631b009abd343d87e86539006781 Mon Sep 17 00:00:00 2001 From: True Zhuanjia Date: Wed, 13 May 2026 17:04:19 +0800 Subject: [PATCH] layout tool batch edit improvement and tips --- VoidLink/Localization/Localizable.xcstrings | 29 +++++++++++++++++++ ...LayoutOnScreenControlsViewController.swift | 22 +++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/VoidLink/Localization/Localizable.xcstrings b/VoidLink/Localization/Localizable.xcstrings index 9cb96f36..8e0f7ded 100644 --- a/VoidLink/Localization/Localizable.xcstrings +++ b/VoidLink/Localization/Localizable.xcstrings @@ -2871,6 +2871,35 @@ } } }, + "bulkEditTip" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Please unfold the folder button before batch editing" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "请先展开 folder 控制夹按键" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "請先展開 folder 控制項夾按鍵" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "請先展開 folder 控制項夾按鍵" + } + } + } + }, "Button label" : { "extractionState" : "manual", "localizations" : { diff --git a/VoidLink/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.swift b/VoidLink/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.swift index 969f0584..62f6491d 100644 --- a/VoidLink/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.swift +++ b/VoidLink/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.swift @@ -2222,16 +2222,28 @@ final class LayoutOnScreenControlsViewController: UIViewController, OnScreenWidg ) } + private func popBulkEditTip() { + AlertControllerUtil.showAlert( + in: self, + title: LocalizationHelper.localizedString(forKey: "Tips"), + message: "\n\(LocalizationHelper.localizedString(forKey: "bulkEditTip"))", + withCancel: false, + buttonTitle: LocalizationHelper.localizedString(forKey: "Got it!"), + countdown: 0, + ) + } @objc private func collectionHiddenChanged(_ sender: UISegmentedControl) { if let selectedWidget { OnScreenWidgetView.set(folded: sender.selectedSegmentIndex == 1, for: selectedWidget) + if sender.selectedSegmentIndex == 1, bulkEditEnabled { + self.bulkEditButtonTapped(self.bulkEditButton) + } } self.bulkEditButton.isEnabled = sender.selectedSegmentIndex == 0 self.importFromOtherButton.isEnabled = sender.selectedSegmentIndex == 0 self.clearFolderButton.isEnabled = sender.selectedSegmentIndex == 0 self.widgetAlphaSlider.isEnabled = sender.selectedSegmentIndex == 1 - // self.placeHolderLabel1.isHidden = sender.selectedSegmentIndex == 0 } @objc private func bulkMoveChanged(_ sender: UISegmentedControl) { @@ -2414,6 +2426,11 @@ final class LayoutOnScreenControlsViewController: UIViewController, OnScreenWidg let point = touch.location(in: widgetPanelStack) return widgetPanelStack.hitTest(point, with: nil) != nil } + + private func bulkEditButtonTouched(_ touch: UITouch) -> Bool { + let point = touch.location(in: bulkEditButton) + return bulkEditButton.bounds.contains(point) + } private func handleWidgetPanelMove(_ touch: UITouch) { guard widgetPanelMovedByTouch else { return } @@ -2441,6 +2458,9 @@ final class LayoutOnScreenControlsViewController: UIViewController, OnScreenWidg if widgetPanelTouched(touch), selectedWidget != nil { GenericUtils.handleWidgetPanelTip(in: self) } + if bulkEditButtonTouched(touch), selectedWidget?.isFolder == true, selectedWidget?.folded == true { + self.popBulkEditTip() + } } for touch in touches { var touchLocation = touch.location(in: view)