Improve groups
This commit is contained in:
@@ -66,7 +66,7 @@ public struct GroupListView: View {
|
||||
let goItem = itemIterator.next()!
|
||||
items.append(OutboundGroupItem(tag: goItem.tag, type: goItem.type, urlTestTime: Date(timeIntervalSince1970: Double(goItem.urlTestTime)), urlTestDelay: UInt16(goItem.urlTestDelay)))
|
||||
}
|
||||
groups.append(OutboundGroup(tag: goGroup.tag, type: goGroup.type, selected: goGroup.selected, selectable: goGroup.selectable, isExpand: goGroup.isExpand(), items: items))
|
||||
groups.append(OutboundGroup(tag: goGroup.tag, type: goGroup.type, selected: goGroup.selected, selectable: goGroup.selectable, isExpand: goGroup.isExpand, items: items))
|
||||
}
|
||||
self.groups = groups
|
||||
isLoading = false
|
||||
|
||||
@@ -68,12 +68,23 @@ public struct GroupView: View {
|
||||
ForEach(Array(itemGroups.enumerated()), id: \.offset) { items in
|
||||
HStack(spacing: 5) {
|
||||
ForEach(items.element, id: \.tag) { it in
|
||||
Rectangle()
|
||||
.fill(it.delayColor)
|
||||
ZStack {
|
||||
Rectangle()
|
||||
.fill(it.delayColor)
|
||||
if it.tag == group.selected {
|
||||
Rectangle()
|
||||
.fill(Color.white)
|
||||
#if !os(tvOS)
|
||||
.frame(width: 5, height: 5)
|
||||
#else
|
||||
.frame(width: 15, height: 15)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#if !os(tvOS)
|
||||
.frame(width: 10, height: 10)
|
||||
.frame(width: 10, height: 10)
|
||||
#else
|
||||
.frame(width: 30, height: 30)
|
||||
.frame(width: 30, height: 30)
|
||||
#endif
|
||||
}
|
||||
}.frame(maxWidth: .infinity, alignment: .topLeading)
|
||||
|
||||
Reference in New Issue
Block a user