Use standard selection colors in timeline and sidebar.

This commit is contained in:
Brent Simmons committed 2026-07-06 20:02:29 -07:00
1 parent ed0f219b8c
commit e3dfca91bf
3 files changed
+15 -30

No files matched your search

@@ -100,13 +100,6 @@ final class MainFeedCollectionViewCell: UICollectionViewCell {
weight: .semibold)
unreadCountLabel.textColor = Assets.Colors.primaryAccent
unreadCountLabel.font = UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .body).pointSize, weight: .semibold)
case (true, .phone):
backgroundConfig.backgroundColor = Assets.Colors.primaryAccent
feedTitle.textColor = .white
unreadCountLabel.textColor = .white
if feedTitle.text == "All Unread" {
faviconView.tintColor = .white
}
default:
feedTitle.textColor = .label
feedTitle.font = UIFont.preferredFont(forTextStyle: .body)
@@ -153,11 +153,6 @@ class MainFeedCollectionViewFolderCell: UICollectionViewCell {
folderTitle.font = UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .body).pointSize, weight: .semibold)
unreadCountLabel.textColor = Assets.Colors.primaryAccent
unreadCountLabel.font = UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .body).pointSize, weight: .semibold)
case (true, .phone):
backgroundConfig.backgroundColor = Assets.Colors.primaryAccent
folderTitle.textColor = .white
unreadCountLabel.textColor = .white
faviconView.tintColor = .white
default:
folderTitle.textColor = .label
faviconView.tintColor = Assets.Colors.primaryAccent
+15 -18
View File
@@ -89,11 +89,10 @@ final class MainTimelineCell: UICollectionViewCell {
backgroundConfig.cornerRadius = 0
}
if state.isSelected {
backgroundConfig.backgroundColor = Assets.Colors.primaryAccent
} else if state.isSwiped {
// Selected cells keep the standard system selection color from updated(for: state).
if state.isSwiped {
backgroundConfig.backgroundColor = .secondarySystemFill
} else {
} else if !state.isSelected {
backgroundConfig.backgroundColor = .clear
}
@@ -106,10 +105,8 @@ final class MainTimelineCell: UICollectionViewCell {
topSeparator.alpha = (isActive || isPreview) ? 0.0 : 1.0
// White foreground is only for the selected state (blue accent background).
// The swiped state uses a subtle gray fill, so it keeps normal label colors.
updateColors(active: state.isSelected)
updateIndicatorView(active: state.isSelected)
updateColors()
updateIndicatorView()
}
func setIconImage(_ image: IconImage) {
@@ -198,31 +195,31 @@ private extension MainTimelineCell {
iconView.isHidden = true
}
updateColors(active: configurationState.isSelected)
updateIndicatorView(active: configurationState.isSelected)
updateColors()
updateIndicatorView()
updateAccessibilityLabel()
setNeedsLayout()
}
func updateColors(active: Bool) {
titleView.textColor = active ? .white : .label
summaryView.textColor = active ? .white : (cellData.title.isEmpty ? .label : .secondaryLabel)
dateView.textColor = active ? .white : .secondaryLabel
feedNameView.textColor = active ? .white : .secondaryLabel
func updateColors() {
titleView.textColor = .label
summaryView.textColor = cellData.title.isEmpty ? .label : .secondaryLabel
dateView.textColor = .secondaryLabel
feedNameView.textColor = .secondaryLabel
}
func updateIndicatorView(active: Bool) {
func updateIndicatorView() {
guard cellData != nil else {
indicatorView.isHidden = true
return
}
if cellData.starred {
indicatorView.iconImage = Assets.Images.starredFeed
indicatorView.tintColor = active ? .white : Assets.Colors.star
indicatorView.tintColor = Assets.Colors.star
indicatorView.isHidden = false
} else if !cellData.read {
indicatorView.iconImage = Assets.Images.unreadCellIndicator
indicatorView.tintColor = active ? .white : Assets.Colors.secondaryAccent
indicatorView.tintColor = Assets.Colors.secondaryAccent
indicatorView.isHidden = false
} else {
indicatorView.isHidden = true