mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-23 23:51:06 +01:00
061872b7ff
- 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.
41 lines
955 B
Swift
41 lines
955 B
Swift
//
|
|
// MasterUnreadIndicatorView.swift
|
|
// NetNewsWire
|
|
//
|
|
// Created by Brent Simmons on 2/16/16.
|
|
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
class MasterUnreadIndicatorView: UIView {
|
|
|
|
var isSelected = false {
|
|
didSet {
|
|
setNeedsDisplay()
|
|
}
|
|
}
|
|
|
|
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.tableViewCellHighlightedTextColor : AppAssets.timelineUnreadCircleColor
|
|
color.setFill()
|
|
MasterUnreadIndicatorView.bezierPath.fill()
|
|
}
|
|
|
|
}
|