mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Turn the star color to white if the article is selected. Issue #2364
This commit is contained in:
@@ -20,7 +20,7 @@ class TimelineTableCellView: NSTableCellView {
|
||||
|
||||
private lazy var iconView = IconView()
|
||||
|
||||
private let starView = TimelineTableCellView.imageView(with: AppAssets.timelineStar, scaling: .scaleNone)
|
||||
private var starView = TimelineTableCellView.imageView(with: AppAssets.timelineStarUnselected, scaling: .scaleNone)
|
||||
private let separatorView = TimelineTableCellView.separatorView()
|
||||
|
||||
private lazy var textFields = {
|
||||
@@ -52,12 +52,14 @@ class TimelineTableCellView: NSTableCellView {
|
||||
var isEmphasized: Bool = false {
|
||||
didSet {
|
||||
unreadIndicatorView.isEmphasized = isEmphasized
|
||||
updateStarView()
|
||||
}
|
||||
}
|
||||
|
||||
var isSelected: Bool = false {
|
||||
didSet {
|
||||
unreadIndicatorView.isSelected = isSelected
|
||||
updateStarView()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,6 +281,11 @@ private extension TimelineTableCellView {
|
||||
}
|
||||
|
||||
func updateStarView() {
|
||||
if isSelected && isEmphasized {
|
||||
starView.image = AppAssets.timelineStarSelected
|
||||
} else {
|
||||
starView.image = AppAssets.timelineStarUnselected
|
||||
}
|
||||
showOrHideView(starView, !cellData.starred)
|
||||
}
|
||||
|
||||
|
||||
@@ -910,7 +910,7 @@ extension TimelineViewController: NSTableViewDelegate {
|
||||
self.toggleArticleStarred(article);
|
||||
tableView.rowActionsVisible = false
|
||||
}
|
||||
action.backgroundColor = AppAssets.swipeMarkUnstarredColor
|
||||
action.backgroundColor = AppAssets.starColor
|
||||
action.image = article.status.starred ? AppAssets.swipeMarkUnstarredImage : AppAssets.swipeMarkStarredImage
|
||||
return [action]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user