folder button minor improvements
This commit is contained in:
1 parent
d14ee640c5
commit
be69af925a
1 file changed
+7
-13
@@ -2758,9 +2758,8 @@ import SVGKit
|
|||||||
folder.folded = hidden
|
folder.folded = hidden
|
||||||
folder.setupAtrributedText()
|
folder.setupAtrributedText()
|
||||||
if hidden {
|
if hidden {
|
||||||
folder.forEachWidget{ widget in
|
for sequence in folder.sequenceSet {
|
||||||
guard widget != folder else {return}
|
guard let widget = OnScreenWidgetView.mapping[sequence], widget != exception else {continue}
|
||||||
if folder.sequenceSet.contains(widget.sequence), widget != exception{
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
widget.isUserInteractionEnabled = false
|
widget.isUserInteractionEnabled = false
|
||||||
let duration = folder.buttonMode == .slideAndHold ? 0.05 : 0.15
|
let duration = folder.buttonMode == .slideAndHold ? 0.05 : 0.15
|
||||||
@@ -2774,11 +2773,9 @@ import SVGKit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else{
|
else{
|
||||||
folder.forEachWidget{ widget in
|
for sequence in folder.sequenceSet {
|
||||||
guard widget != folder else {return}
|
guard let widget = OnScreenWidgetView.mapping[sequence], widget != exception else {continue}
|
||||||
if folder.sequenceSet.contains(widget.sequence), widget != exception{
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
widget.center = folder.storedCenter
|
widget.center = folder.storedCenter
|
||||||
widget.isUserInteractionEnabled = false
|
widget.isUserInteractionEnabled = false
|
||||||
@@ -2793,17 +2790,14 @@ import SVGKit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if recursive {
|
if recursive {
|
||||||
folder.forEachWidget{ widget in
|
for sequence in folder.sequenceSet {
|
||||||
guard widget != folder else {return}
|
guard let widget = OnScreenWidgetView.mapping[sequence] else {continue}
|
||||||
guard widget.isFolder, widget != exception else {return}
|
guard widget.isFolder, widget != exception else {continue}
|
||||||
if folder.sequenceSet.contains(widget.sequence){
|
|
||||||
OnScreenWidgetView.setCollection(hidden: hidden, for: widget, exception: exception, recursive: true)
|
OnScreenWidgetView.setCollection(hidden: hidden, for: widget, exception: exception, recursive: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@objc static func set(folded:Bool, for folder:OnScreenWidgetView) { // folder综合逻辑
|
@objc static func set(folded:Bool, for folder:OnScreenWidgetView) { // folder综合逻辑
|
||||||
guard folder.isFolder else {return}
|
guard folder.isFolder else {return}
|
||||||
|
|||||||
Reference in new issue
Block a user