layout tool batch edit improvement and tips

This commit is contained in:
True Zhuanjia
2026-05-13 17:04:19 +08:00
parent 2d1a1573e1
commit c08bb232cd
2 changed files with 50 additions and 1 deletions
@@ -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" : {
@@ -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)