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