Capsule design for pills

This commit is contained in:
Thomas Ricouard 2024-09-25 12:50:05 +02:00
parent 9fbd0a6a2f
commit f0c91784d0

View file

@ -66,15 +66,12 @@ struct TimelineQuickAccessPills: View {
case .hashtag: case .hashtag:
Label(filter.title.replacingOccurrences(of: "#", with: ""), Label(filter.title.replacingOccurrences(of: "#", with: ""),
systemImage: filter.iconName()) systemImage: filter.iconName())
.font(.callout)
case let .list(list): case let .list(list):
if let list = currentAccount.lists.first(where: { $0.id == list.id }) { if let list = currentAccount.lists.first(where: { $0.id == list.id }) {
Label(list.title, systemImage: filter.iconName()) Label(list.title, systemImage: filter.iconName())
.font(.callout)
} }
default: default:
Label(filter.localizedTitle(), systemImage: filter.iconName()) Label(filter.localizedTitle(), systemImage: filter.iconName())
.font(.callout)
} }
} }
.transition(.push(from: .leading).combined(with: .opacity)) .transition(.push(from: .leading).combined(with: .opacity))
@ -85,6 +82,9 @@ struct TimelineQuickAccessPills: View {
.onDrop(of: [.text], delegate: PillDropDelegate(destinationItem: filter, .onDrop(of: [.text], delegate: PillDropDelegate(destinationItem: filter,
items: $pinnedFilters, items: $pinnedFilters,
draggedItem: $draggedFilter)) draggedItem: $draggedFilter))
.buttonBorderShape(.capsule)
.controlSize(.mini)
} }
private func isFilterSupported(_ filter: TimelineFilter) -> Bool { private func isFilterSupported(_ filter: TimelineFilter) -> Bool {