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:
@@ -38,21 +38,31 @@ class MasterTimelineTableViewCell: NNWTableViewCell {
|
||||
commonInit()
|
||||
}
|
||||
|
||||
override func applyThemeProperties() {
|
||||
super.applyThemeProperties()
|
||||
|
||||
let highlightedTextColor = AppAssets.tableViewCellHighlightedTextColor
|
||||
|
||||
titleView.highlightedTextColor = highlightedTextColor
|
||||
summaryView.highlightedTextColor = highlightedTextColor
|
||||
dateView.highlightedTextColor = highlightedTextColor
|
||||
feedNameView.highlightedTextColor = highlightedTextColor
|
||||
}
|
||||
|
||||
override var frame: CGRect {
|
||||
didSet {
|
||||
setNeedsLayout()
|
||||
}
|
||||
}
|
||||
|
||||
override func setHighlighted(_ highlighted: Bool, animated: Bool) {
|
||||
super.setHighlighted(highlighted, animated: animated)
|
||||
unreadIndicatorView.isSelected = isHighlighted || isSelected
|
||||
}
|
||||
|
||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
let selectedTextColor = selected ? AppAssets.selectedTextColor : UIColor.label
|
||||
titleView.textColor = selectedTextColor
|
||||
summaryView.textColor = selectedTextColor
|
||||
dateView.textColor = selectedTextColor
|
||||
feedNameView.textColor = selectedTextColor
|
||||
unreadIndicatorView.isSelected = selected
|
||||
|
||||
super.setSelected(selected, animated: animated)
|
||||
unreadIndicatorView.isSelected = isHighlighted || isSelected
|
||||
}
|
||||
|
||||
override func sizeThatFits(_ size: CGSize) -> CGSize {
|
||||
|
||||
Reference in New Issue
Block a user