diff options
| author | Dustin Mierau <dustin@mierau.me> | 2024-06-30 17:46:30 -0700 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2024-06-30 17:46:30 -0700 |
| commit | 038df124a9c9d0ec7e7f3a7387669d5273a5bf49 (patch) | |
| tree | 47f9c39c14a4b48e83be1c42885d92bd88384d47 /Hotline/macOS/NewsItemView.swift | |
| parent | 3c352f194c7d14cc8a1ee23ec8fb7b834132d9a0 (diff) | |
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.
Diffstat (limited to 'Hotline/macOS/NewsItemView.swift')
| -rw-r--r-- | Hotline/macOS/NewsItemView.swift | 55 |
1 files changed, 33 insertions, 22 deletions
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) |