From 038df124a9c9d0ec7e7f3a7387669d5273a5bf49 Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Sun, 30 Jun 2024 17:46:30 -0700 Subject: A pass on icons. Sleeker toolbar window. Fix Accounts and News menu item disable states. Don't request banner from older servers. Cleanup News list display. --- Hotline/macOS/NewsItemView.swift | 55 ++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 22 deletions(-) (limited to 'Hotline/macOS/NewsItemView.swift') diff --git a/Hotline/macOS/NewsItemView.swift b/Hotline/macOS/NewsItemView.swift index 5cd9ce4..9614663 100644 --- a/Hotline/macOS/NewsItemView.swift +++ b/Hotline/macOS/NewsItemView.swift @@ -79,29 +79,40 @@ struct NewsItemView: View { Spacer() - if news.type == .bundle || news.type == .category { - ZStack { -// Text("^[\(news.count) \(news.type == .bundle ? "Category" : "Post")](inflect: true)") - Text("\(news.count)") - .foregroundStyle(.clear) -// .font(.caption) - .lineLimit(1) - .padding([.leading, .trailing], 8) - .padding([.top, .bottom], 2) - .background(.secondary) - .clipShape(Capsule()) - - Text("\(news.count)") - .foregroundStyle(.white) -// .font(.caption) - .lineLimit(1) - .padding([.leading, .trailing], 8) - .padding([.top, .bottom], 2) - .blendMode(.destinationOut) - } - .drawingGroup(opaque: false) + if news.type == .category && news.count > 0 { + Text("^[\(news.count) Post](inflect: true)") + .lineLimit(1) + .foregroundStyle(.secondary) + .padding(.trailing, 8) } - if news.type == .article && news.articleUsername != nil { +// if news.type == .bundle { +// Text("\(news.count)") +// .lineLimit(1) +// .foregroundStyle(.tertiary) +// .padding(.trailing, 8) + +// ZStack { +// Text("^[\(news.count) \(news.type == .bundle ? "Category" : "Post")](inflect: true)") +// Text("\(news.count)") +// .foregroundStyle(.clear) +//// .font(.caption) +// .lineLimit(1) +// .padding([.leading, .trailing], 8) +// .padding([.top, .bottom], 2) +// .background(.secondary) +// .clipShape(Capsule()) +// +// Text("\(news.count)") +// .foregroundStyle(.white) +//// .font(.caption) +// .lineLimit(1) +// .padding([.leading, .trailing], 8) +// .padding([.top, .bottom], 2) +// .blendMode(.destinationOut) +// } +// .drawingGroup(opaque: false) +// } + else if news.type == .article && news.articleUsername != nil { if let d = news.articleDate { Text(NewsItemView.relativeDateFormatter.localizedString(for: d, relativeTo: Date.now)) .lineLimit(1) -- cgit