mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-18 12:31:01 +01:00
Use colorful smart feed icons on iOS
This commit is contained in:
parent
f8cf5676e9
commit
d05b450cc5
@ -206,7 +206,8 @@ struct AppAssets {
|
||||
}()
|
||||
|
||||
static var starredFeedImage: IconImage = {
|
||||
return IconImage(UIImage(systemName: "star.fill")!)
|
||||
let image = UIImage(systemName: "star.fill")!
|
||||
return IconImage(image, isSymbol: true, preferredColor: AppAssets.starColor.cgColor)
|
||||
}()
|
||||
|
||||
static var tickMarkColor: UIColor = {
|
||||
@ -219,7 +220,8 @@ struct AppAssets {
|
||||
}()
|
||||
|
||||
static var todayFeedImage: IconImage = {
|
||||
return IconImage(UIImage(systemName: "sun.max.fill")!)
|
||||
let image = UIImage(systemName: "sun.max.fill")!
|
||||
return IconImage(image, isSymbol: true, preferredColor: UIColor.systemOrange.cgColor)
|
||||
}()
|
||||
|
||||
static var trashImage: UIImage = {
|
||||
@ -227,7 +229,8 @@ struct AppAssets {
|
||||
}()
|
||||
|
||||
static var unreadFeedImage: IconImage = {
|
||||
return IconImage(UIImage(systemName: "largecircle.fill.circle")!)
|
||||
let image = UIImage(systemName: "largecircle.fill.circle")!
|
||||
return IconImage(image, isSymbol: true, preferredColor: AppAssets.secondaryAccentColor.cgColor)
|
||||
}()
|
||||
|
||||
static var vibrantTextColor: UIColor = {
|
||||
|
@ -155,10 +155,22 @@ class MasterFeedTableViewCell : VibrantTableViewCell {
|
||||
|
||||
override func updateVibrancy(animated: Bool) {
|
||||
super.updateVibrancy(animated: animated)
|
||||
let iconTintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : AppAssets.secondaryAccentColor
|
||||
|
||||
let iconTintColor: UIColor
|
||||
if isHighlighted || isSelected {
|
||||
iconTintColor = AppAssets.vibrantTextColor
|
||||
} else {
|
||||
if let preferredColor = iconImage?.preferredColor {
|
||||
iconTintColor = UIColor(cgColor: preferredColor)
|
||||
} else {
|
||||
iconTintColor = AppAssets.secondaryAccentColor
|
||||
}
|
||||
}
|
||||
|
||||
UIView.animate(withDuration: duration(animated: animated)) {
|
||||
self.iconView.tintColor = iconTintColor
|
||||
}
|
||||
|
||||
updateLabelVibrancy(titleView, color: labelColor, animated: animated)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user