mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Simplified/corrected highlighted/selected appearance of feed and timeline cells.
- Set the highlighted text color on labels in table cells. This will be used for both the highlight and selected states automatically. (And since it is used for both states, we avoid anachronistic state where we have black text on a dark blue background in light mode as we transition from none -> highlighted -> selected.) - Keep the selected/highlighted overrides to adjust colors for non-UIControl subelements.
This commit is contained in:
@@ -104,11 +104,24 @@ class MasterFeedTableViewCell : NNWTableViewCell {
|
||||
super.init(coder: coder)
|
||||
commonInit()
|
||||
}
|
||||
|
||||
override func applyThemeProperties() {
|
||||
super.applyThemeProperties()
|
||||
titleView.highlightedTextColor = AppAssets.tableViewCellHighlightedTextColor
|
||||
}
|
||||
|
||||
override func setHighlighted(_ highlighted: Bool, animated: Bool) {
|
||||
super.setHighlighted(highlighted, animated: animated)
|
||||
|
||||
let tintColor = isHighlighted || isSelected ? AppAssets.tableViewCellHighlightedTextColor : AppAssets.netNewsWireBlueColor
|
||||
faviconImageView.tintColor = tintColor
|
||||
}
|
||||
|
||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
titleView.textColor = selected ? AppAssets.selectedTextColor : UIColor.label
|
||||
faviconImageView.tintColor = selected ? AppAssets.selectedTextColor : AppAssets.netNewsWireBlueColor
|
||||
super.setSelected(selected, animated: animated)
|
||||
|
||||
let tintColor = isHighlighted || isSelected ? AppAssets.tableViewCellHighlightedTextColor : AppAssets.netNewsWireBlueColor
|
||||
faviconImageView.tintColor = tintColor
|
||||
}
|
||||
|
||||
override func willTransition(to state: UITableViewCell.StateMask) {
|
||||
|
||||
Reference in New Issue
Block a user