mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Merge branch 'master' of https://github.com/brentsimmons/NetNewsWire
This commit is contained in:
@@ -34,35 +34,27 @@ class MasterTimelineTableViewCell: VibrantTableViewCell {
|
||||
commonInit()
|
||||
}
|
||||
|
||||
override func applyThemeProperties() {
|
||||
super.applyThemeProperties()
|
||||
|
||||
let highlightedTextColor = AppAssets.vibrantTextColor
|
||||
|
||||
titleView.highlightedTextColor = highlightedTextColor
|
||||
summaryView.highlightedTextColor = highlightedTextColor
|
||||
dateView.highlightedTextColor = highlightedTextColor
|
||||
feedNameView.highlightedTextColor = highlightedTextColor
|
||||
|
||||
backgroundColor = AppAssets.timelineBackgroundColor
|
||||
}
|
||||
|
||||
override var frame: CGRect {
|
||||
didSet {
|
||||
setNeedsLayout()
|
||||
}
|
||||
}
|
||||
|
||||
override func setHighlighted(_ highlighted: Bool, animated: Bool) {
|
||||
super.setHighlighted(highlighted, animated: animated)
|
||||
unreadIndicatorView.isSelected = isHighlighted || isSelected
|
||||
override func updateVibrancy(animated: Bool) {
|
||||
updateLabelVibrancy(titleView, animated: animated)
|
||||
updateLabelVibrancy(summaryView, animated: animated)
|
||||
updateLabelVibrancy(dateView, animated: animated)
|
||||
updateLabelVibrancy(feedNameView, animated: animated)
|
||||
|
||||
UIView.animate(withDuration: duration(animated: animated)) {
|
||||
if self.isHighlighted || self.isSelected {
|
||||
self.unreadIndicatorView.backgroundColor = AppAssets.vibrantTextColor
|
||||
} else {
|
||||
self.unreadIndicatorView.backgroundColor = AppAssets.secondaryAccentColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
super.setSelected(selected, animated: animated)
|
||||
unreadIndicatorView.isSelected = isHighlighted || isSelected
|
||||
}
|
||||
|
||||
|
||||
override func sizeThatFits(_ size: CGSize) -> CGSize {
|
||||
let layout = updatedLayout(width: size.width)
|
||||
return CGSize(width: size.width, height: layout.height)
|
||||
|
||||
@@ -10,31 +10,10 @@ import UIKit
|
||||
|
||||
class MasterUnreadIndicatorView: UIView {
|
||||
|
||||
var isSelected = false {
|
||||
didSet {
|
||||
setNeedsDisplay()
|
||||
}
|
||||
override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
layer.cornerRadius = frame.size.width / 2.0
|
||||
clipsToBounds = true
|
||||
}
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
self.isOpaque = false
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
self.isOpaque = false
|
||||
}
|
||||
|
||||
static let bezierPath: UIBezierPath = {
|
||||
let r = CGRect(x: 0.0, y: 0.0, width: MasterTimelineDefaultCellLayout.unreadCircleDimension, height: MasterTimelineDefaultCellLayout.unreadCircleDimension)
|
||||
return UIBezierPath(ovalIn: r)
|
||||
}()
|
||||
|
||||
override func draw(_ dirtyRect: CGRect) {
|
||||
let color = isSelected ? AppAssets.vibrantTextColor : AppAssets.secondaryAccentColor
|
||||
color.setFill()
|
||||
MasterUnreadIndicatorView.bezierPath.fill()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -74,6 +74,11 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
||||
super.viewWillAppear(animated)
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
tableView.layer.speed = AppAssets.layerSpeed
|
||||
}
|
||||
|
||||
// MARK: Actions
|
||||
|
||||
@IBAction func markAllAsRead(_ sender: Any) {
|
||||
|
||||
Reference in New Issue
Block a user