mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-09 00:28:53 +01:00
Update timeline theme. Issue #1169
This commit is contained in:
parent
cf7ea99cb6
commit
21aaf71cbf
@ -157,6 +157,10 @@ struct AppAssets {
|
|||||||
return UIImage(systemName: "star.fill")!
|
return UIImage(systemName: "star.fill")!
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
static var timelineBackgroundColor: UIColor = {
|
||||||
|
return UIColor(named: "timelineBackgroundColor")!
|
||||||
|
}()
|
||||||
|
|
||||||
static var timelineStarImage: UIImage = {
|
static var timelineStarImage: UIImage = {
|
||||||
let image = UIImage(systemName: "star.fill")!
|
let image = UIImage(systemName: "star.fill")!
|
||||||
return image.withTintColor(AppAssets.starColor, renderingMode: .alwaysOriginal)
|
return image.withTintColor(AppAssets.starColor, renderingMode: .alwaysOriginal)
|
||||||
|
@ -35,7 +35,7 @@ struct MasterTimelineAccessibilityCellLayout: MasterTimelineCellLayout {
|
|||||||
currentPoint.x += MasterTimelineDefaultCellLayout.unreadCircleDimension + MasterTimelineDefaultCellLayout.unreadCircleMarginRight
|
currentPoint.x += MasterTimelineDefaultCellLayout.unreadCircleDimension + MasterTimelineDefaultCellLayout.unreadCircleMarginRight
|
||||||
|
|
||||||
// Separator Insets
|
// Separator Insets
|
||||||
self.separatorInsets = UIEdgeInsets(top: 0, left: currentPoint.x, bottom: 0, right: 0)
|
self.separatorInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
|
||||||
|
|
||||||
// Avatar
|
// Avatar
|
||||||
if cellData.showAvatar {
|
if cellData.showAvatar {
|
||||||
|
@ -68,7 +68,7 @@ struct MasterTimelineDefaultCellLayout: MasterTimelineCellLayout {
|
|||||||
currentPoint.x += MasterTimelineDefaultCellLayout.unreadCircleDimension + MasterTimelineDefaultCellLayout.unreadCircleMarginRight
|
currentPoint.x += MasterTimelineDefaultCellLayout.unreadCircleDimension + MasterTimelineDefaultCellLayout.unreadCircleMarginRight
|
||||||
|
|
||||||
// Separator Insets
|
// Separator Insets
|
||||||
self.separatorInsets = UIEdgeInsets(top: 0, left: currentPoint.x, bottom: 0, right: 0)
|
self.separatorInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
|
||||||
|
|
||||||
// Avatar
|
// Avatar
|
||||||
if cellData.showAvatar {
|
if cellData.showAvatar {
|
||||||
|
@ -23,6 +23,12 @@ class MasterTimelineTableViewCell: VibrantTableViewCell {
|
|||||||
return NonIntrinsicImageView(image: AppAssets.timelineStarImage)
|
return NonIntrinsicImageView(image: AppAssets.timelineStarImage)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
private let separatorAccent: UIView = {
|
||||||
|
let view = UIView()
|
||||||
|
view.backgroundColor = UIColor.white
|
||||||
|
return view
|
||||||
|
}()
|
||||||
|
|
||||||
var cellData: MasterTimelineCellData! {
|
var cellData: MasterTimelineCellData! {
|
||||||
didSet {
|
didSet {
|
||||||
updateSubviews()
|
updateSubviews()
|
||||||
@ -43,6 +49,8 @@ class MasterTimelineTableViewCell: VibrantTableViewCell {
|
|||||||
summaryView.highlightedTextColor = highlightedTextColor
|
summaryView.highlightedTextColor = highlightedTextColor
|
||||||
dateView.highlightedTextColor = highlightedTextColor
|
dateView.highlightedTextColor = highlightedTextColor
|
||||||
feedNameView.highlightedTextColor = highlightedTextColor
|
feedNameView.highlightedTextColor = highlightedTextColor
|
||||||
|
|
||||||
|
backgroundColor = AppAssets.timelineBackgroundColor
|
||||||
}
|
}
|
||||||
|
|
||||||
override var frame: CGRect {
|
override var frame: CGRect {
|
||||||
@ -82,6 +90,10 @@ class MasterTimelineTableViewCell: VibrantTableViewCell {
|
|||||||
|
|
||||||
separatorInset = layout.separatorInsets
|
separatorInset = layout.separatorInsets
|
||||||
|
|
||||||
|
if traitCollection.userInterfaceStyle == .light {
|
||||||
|
let separatorAccentRect = CGRect(x: safeAreaInsets.left, y: frame.height - 2, width: frame.width - safeAreaInsets.right - safeAreaInsets.left, height: 1)
|
||||||
|
separatorAccent.setFrameIfNotEqual(separatorAccentRect)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func setAvatarImage(_ image: UIImage) {
|
func setAvatarImage(_ image: UIImage) {
|
||||||
@ -137,7 +149,8 @@ private extension MasterTimelineTableViewCell {
|
|||||||
addSubviewAtInit(feedNameView, hidden: true)
|
addSubviewAtInit(feedNameView, hidden: true)
|
||||||
addSubviewAtInit(avatarView, hidden: true)
|
addSubviewAtInit(avatarView, hidden: true)
|
||||||
addSubviewAtInit(starView, hidden: true)
|
addSubviewAtInit(starView, hidden: true)
|
||||||
|
addSubviewAtInit(separatorAccent, hidden: false)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func updatedLayout(width: CGFloat) -> MasterTimelineCellLayout {
|
func updatedLayout(width: CGFloat) -> MasterTimelineCellLayout {
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
},
|
||||||
|
"colors" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"color" : {
|
||||||
|
"color-space" : "srgb",
|
||||||
|
"components" : {
|
||||||
|
"red" : "247",
|
||||||
|
"alpha" : "1.000",
|
||||||
|
"blue" : "247",
|
||||||
|
"green" : "247"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"appearances" : [
|
||||||
|
{
|
||||||
|
"appearance" : "luminosity",
|
||||||
|
"value" : "dark"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"color" : {
|
||||||
|
"platform" : "ios",
|
||||||
|
"reference" : "systemBackgroundColor"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user