mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-11 09:14:06 +01:00
Make selected indicator white
This commit is contained in:
parent
4446fa0ca9
commit
29386d74d6
@ -268,6 +268,10 @@ struct AppAssets {
|
||||
#endif
|
||||
}
|
||||
|
||||
static var timelineUnreadSelected: Image {
|
||||
return Image(systemName: "circle.fill")
|
||||
}
|
||||
|
||||
static var todayFeedImage: IconImage = {
|
||||
#if os(macOS)
|
||||
let image = NSImage(systemSymbolName: "sun.max.fill", accessibilityDescription: nil)!
|
||||
|
@ -10,6 +10,7 @@ import SwiftUI
|
||||
|
||||
struct TimelineItemStatusView: View {
|
||||
|
||||
var selected: Bool
|
||||
var status: TimelineItemStatus
|
||||
|
||||
@ViewBuilder var statusView: some View {
|
||||
@ -17,10 +18,17 @@ struct TimelineItemStatusView: View {
|
||||
Spacer().frame(width: 12)
|
||||
switch status {
|
||||
case .showUnread:
|
||||
AppAssets.timelineUnread
|
||||
.resizable()
|
||||
.frame(width: 8, height: 8, alignment: .center)
|
||||
.padding(.all, 2)
|
||||
if selected {
|
||||
AppAssets.timelineUnreadSelected
|
||||
.resizable()
|
||||
.frame(width: 8, height: 8, alignment: .center)
|
||||
.padding(.all, 2)
|
||||
} else {
|
||||
AppAssets.timelineUnread
|
||||
.resizable()
|
||||
.frame(width: 8, height: 8, alignment: .center)
|
||||
.padding(.all, 2)
|
||||
}
|
||||
case .showStar:
|
||||
AppAssets.timelineStarred
|
||||
.resizable()
|
||||
|
@ -13,6 +13,7 @@ struct TimelineItemView: View {
|
||||
@EnvironmentObject var defaults: AppDefaults
|
||||
@StateObject var articleIconImageLoader = ArticleIconImageLoader()
|
||||
|
||||
var selected: Bool
|
||||
var width: CGFloat
|
||||
var timelineItem: TimelineItem
|
||||
|
||||
@ -25,7 +26,7 @@ struct TimelineItemView: View {
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .top) {
|
||||
TimelineItemStatusView(status: timelineItem.status)
|
||||
TimelineItemStatusView(selected: selected, status: timelineItem.status)
|
||||
if let image = articleIconImageLoader.image {
|
||||
IconImageView(iconImage: image)
|
||||
.frame(width: CGFloat(defaults.timelineIconDimensions), height: CGFloat(defaults.timelineIconDimensions), alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
|
||||
|
@ -41,7 +41,8 @@ struct TimelineView: View {
|
||||
EmptyView()
|
||||
}.hidden()
|
||||
List(timelineModel.timelineItems, selection: $timelineModel.selectedArticleIDs) { timelineItem in
|
||||
TimelineItemView(width: proxy.size.width, timelineItem: timelineItem)
|
||||
let selected = timelineModel.selectedArticleIDs.contains(timelineItem.article.articleID)
|
||||
TimelineItemView(selected: selected, width: proxy.size.width, timelineItem: timelineItem)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user