Skip to content

Commit

Permalink
Update ListRow multiSelection to match Figma. (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave authored Apr 5, 2024
1 parent cc12e61 commit 6d42477
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
20 changes: 3 additions & 17 deletions Sources/Compound/List/ListRowAccessory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,12 @@ public struct ListRowAccessory: View {
.padding(.vertical, verticalPaddingFix)
case .multiSelected:
CompoundIcon(\.checkCircleSolid)
.foregroundColor(isEnabled ? .compound.iconPrimary : .compound.iconDisabled)
.foregroundColor(isEnabled ? .compound.iconSuccessPrimary : .compound.iconDisabled)
.accessibilityAddTraits(.isSelected)
.padding(.vertical, verticalPaddingFix)
case .multiUnselected:
CompoundIcon(\.checkCircle)
.foregroundColor(isEnabled ? .compound.iconTertiary : .compound.iconDisabled)
.overlay { Circle().inset(by: circleOverlayInsets).fill(.background) } // This is a bodge.
CompoundIcon(\.circle)
.foregroundColor(isEnabled ? .compound.borderInteractivePrimary : .compound.borderDisabled)
.padding(.vertical, verticalPaddingFix)
}
}
Expand Down Expand Up @@ -122,16 +121,3 @@ struct ListRowAccessory_Previews: PreviewProvider, PrefireProvider {
}
}
}

/// Just to prove that the overlay bodge works for all Dynamic Type sizes.
struct MultiUnselectedAccessory_Previews: PreviewProvider, PrefireProvider {
static var previews: some View {
VStack {
ForEach(DynamicTypeSize.allCases, id: \.self) { size in
ListRowAccessory.multiSelection(false)
.dynamicTypeSize(size)
}
}
.previewDisplayName("Fake circle icon")
}
}

0 comments on commit 6d42477

Please sign in to comment.