folder button minor improvements

This commit is contained in:
True Zhuanjia committed 2026-02-01 11:26:39 +08:00
1 parent d14ee640c5
commit be69af925a
1 file changed
+7 -13
+7 -13
View File
@@ -2758,9 +2758,8 @@ import SVGKit
folder.folded = hidden
folder.setupAtrributedText()
if hidden {
folder.forEachWidget{ widget in
guard widget != folder else {return}
if folder.sequenceSet.contains(widget.sequence), widget != exception{
for sequence in folder.sequenceSet {
guard let widget = OnScreenWidgetView.mapping[sequence], widget != exception else {continue}
DispatchQueue.main.async {
widget.isUserInteractionEnabled = false
let duration = folder.buttonMode == .slideAndHold ? 0.05 : 0.15
@@ -2774,11 +2773,9 @@ import SVGKit
}
}
}
}
else{
folder.forEachWidget{ widget in
guard widget != folder else {return}
if folder.sequenceSet.contains(widget.sequence), widget != exception{
for sequence in folder.sequenceSet {
guard let widget = OnScreenWidgetView.mapping[sequence], widget != exception else {continue}
DispatchQueue.main.async {
widget.center = folder.storedCenter
widget.isUserInteractionEnabled = false
@@ -2793,17 +2790,14 @@ import SVGKit
}
}
}
}
if recursive {
folder.forEachWidget{ widget in
guard widget != folder else {return}
guard widget.isFolder, widget != exception else {return}
if folder.sequenceSet.contains(widget.sequence){
for sequence in folder.sequenceSet {
guard let widget = OnScreenWidgetView.mapping[sequence] else {continue}
guard widget.isFolder, widget != exception else {continue}
OnScreenWidgetView.setCollection(hidden: hidden, for: widget, exception: exception, recursive: true)
}
}
}
}
@objc static func set(folded:Bool, for folder:OnScreenWidgetView) { // folder综合逻辑
guard folder.isFolder else {return}