mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Hide the bottom separator on the Timeline for the last cell
This commit is contained in:
@@ -27,8 +27,9 @@ struct MasterTimelineCellData {
|
||||
let starred: Bool
|
||||
let numberOfLines: Int
|
||||
let iconSize: IconSize
|
||||
|
||||
init(article: Article, showFeedName: ShowFeedName, feedName: String?, byline: String?, iconImage: IconImage?, showIcon: Bool, featuredImage: UIImage?, numberOfLines: Int, iconSize: IconSize) {
|
||||
let hideSeparator: Bool
|
||||
|
||||
init(article: Article, showFeedName: ShowFeedName, feedName: String?, byline: String?, iconImage: IconImage?, showIcon: Bool, featuredImage: UIImage?, numberOfLines: Int, iconSize: IconSize, hideSeparator: Bool) {
|
||||
|
||||
self.title = ArticleStringFormatter.truncatedTitle(article)
|
||||
self.attributedTitle = ArticleStringFormatter.attributedTruncatedTitle(article)
|
||||
@@ -65,6 +66,7 @@ struct MasterTimelineCellData {
|
||||
self.starred = article.status.starred
|
||||
self.numberOfLines = numberOfLines
|
||||
self.iconSize = iconSize
|
||||
self.hideSeparator = hideSeparator
|
||||
|
||||
}
|
||||
|
||||
@@ -83,6 +85,7 @@ struct MasterTimelineCellData {
|
||||
self.starred = false
|
||||
self.numberOfLines = 0
|
||||
self.iconSize = .medium
|
||||
self.hideSeparator = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -82,7 +82,6 @@ class MasterTimelineTableViewCell: VibrantTableViewCell {
|
||||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
|
||||
super.layoutSubviews()
|
||||
|
||||
let layout = updatedLayout(width: bounds.width)
|
||||
@@ -94,8 +93,6 @@ class MasterTimelineTableViewCell: VibrantTableViewCell {
|
||||
setFrame(for: summaryView, rect: layout.summaryRect)
|
||||
feedNameView.setFrameIfNotEqual(layout.feedNameRect)
|
||||
dateView.setFrameIfNotEqual(layout.dateRect)
|
||||
|
||||
separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
|
||||
}
|
||||
|
||||
func setIconImage(_ image: IconImage) {
|
||||
@@ -272,6 +269,14 @@ private extension MasterTimelineTableViewCell {
|
||||
accessibilityLabel = label
|
||||
}
|
||||
|
||||
func updateSeparator() {
|
||||
if cellData?.hideSeparator ?? false {
|
||||
separatorInset = UIEdgeInsets(top: 0, left: bounds.width + 1, bottom: 0, right: 0)
|
||||
} else {
|
||||
separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
|
||||
}
|
||||
}
|
||||
|
||||
func makeIconEmpty() {
|
||||
if iconView.iconImage != nil {
|
||||
iconView.iconImage = nil
|
||||
@@ -305,6 +310,7 @@ private extension MasterTimelineTableViewCell {
|
||||
updateStarView()
|
||||
updateIconImage()
|
||||
updateAccessiblityLabel()
|
||||
updateSeparator()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user