Turn the star color to white if the article is selected. Issue #2364

This commit is contained in:
Maurice Parker
2020-08-19 20:00:34 -05:00
parent b0b2ab04fc
commit d3cebfaccb
10 changed files with 29 additions and 19 deletions

View File

@@ -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)
}

View File

@@ -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]