From 6a95b53616a4abfa306ddce43151cf4fefbd20ed Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Mon, 17 Nov 2025 11:48:02 -0800 Subject: New macOS 26 app icon. Prepping NewsView for category/topic management. --- Hotline/Assets/App Icon.icon/Assets/hl.svg | 3 + Hotline/Assets/App Icon.icon/icon.json | 49 +++++++++++++++ Hotline/macOS/News/NewsView.swift | 96 ++++++++++++++++++------------ 3 files changed, 110 insertions(+), 38 deletions(-) create mode 100644 Hotline/Assets/App Icon.icon/Assets/hl.svg create mode 100644 Hotline/Assets/App Icon.icon/icon.json (limited to 'Hotline') diff --git a/Hotline/Assets/App Icon.icon/Assets/hl.svg b/Hotline/Assets/App Icon.icon/Assets/hl.svg new file mode 100644 index 0000000..05a1bbb --- /dev/null +++ b/Hotline/Assets/App Icon.icon/Assets/hl.svg @@ -0,0 +1,3 @@ + + + diff --git a/Hotline/Assets/App Icon.icon/icon.json b/Hotline/Assets/App Icon.icon/icon.json new file mode 100644 index 0000000..e147fe7 --- /dev/null +++ b/Hotline/Assets/App Icon.icon/icon.json @@ -0,0 +1,49 @@ +{ + "fill" : { + "linear-gradient" : [ + "display-p3:0.98824,0.15686,0.15686,1.00000", + "srgb:0.83024,0.00000,0.00000,1.00000" + ], + "orientation" : { + "start" : { + "x" : 0.5, + "y" : 0 + }, + "stop" : { + "x" : 0.5, + "y" : 0.7 + } + } + }, + "groups" : [ + { + "layers" : [ + { + "image-name" : "hl.svg", + "name" : "hl", + "position" : { + "scale" : 1.33, + "translation-in-points" : [ + 0, + -4.509732002588862e-05 + ] + } + } + ], + "shadow" : { + "kind" : "neutral", + "opacity" : 0.5 + }, + "translucency" : { + "enabled" : true, + "value" : 0.5 + } + } + ], + "supported-platforms" : { + "circles" : [ + "watchOS" + ], + "squares" : "shared" + } +} \ No newline at end of file diff --git a/Hotline/macOS/News/NewsView.swift b/Hotline/macOS/News/NewsView.swift index a07a441..39e8d68 100644 --- a/Hotline/macOS/News/NewsView.swift +++ b/Hotline/macOS/News/NewsView.swift @@ -9,7 +9,7 @@ struct NewsView: View { @State private var selection: NewsInfo? @State private var articleText: String? - @State private var splitHidden = SideHolder(.bottom) + @State private var splitHidden: SideHolder = SideHolder(.bottom) @State private var splitFraction = FractionHolder.usingUserDefaults(0.25, key: "News Split Fraction") @State private var editorOpen: Bool = false @State private var replyOpen: Bool = false @@ -20,19 +20,17 @@ struct NewsView: View { if model.serverVersion < 151 { disabledNewsView } + else if !model.newsLoaded { + loadingIndicator + } + else if model.news.isEmpty { + emptyNewsView + } else { NavigationStack { VSplit( top: { - if !model.newsLoaded { - loadingIndicator - } - else if model.news.isEmpty { - emptyNewsView - } - else { - newsBrowser - } + newsBrowser }, bottom: { articleViewer @@ -45,13 +43,13 @@ struct NewsView: View { .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color(nsColor: .textBackgroundColor)) } - .task { - if !model.newsLoaded { - loading = true - try? await model.getNewsList() - loading = false - } - } + } + } + .task { + if !model.newsLoaded { + loading = true + try? await model.getNewsList() + loading = false } } .sheet(isPresented: $editorOpen) { @@ -78,7 +76,7 @@ struct NewsView: View { } } .toolbar { - ToolbarItem(placement: .primaryAction) { + ToolbarItem { Button { if selection?.type == .category || selection?.type == .article { editorOpen = true @@ -86,11 +84,11 @@ struct NewsView: View { } label: { Image(systemName: "square.and.pencil") } - .help("New Post") + .help("New post under current topic") .disabled(selection?.type != .category && selection?.type != .article) } - ToolbarItem(placement: .primaryAction) { + ToolbarItem { Button { if selection?.type == .article { replyOpen = true @@ -98,11 +96,37 @@ struct NewsView: View { } label: { Image(systemName: "arrowshape.turn.up.left") } - .help("Reply to Post") + .help("Reply to selected post") .disabled(selection?.type != .article) } - ToolbarItem(placement: .primaryAction) { + if #available(macOS 26.0, *) { + ToolbarSpacer(.fixed) + } + + ToolbarItem { + Button { +// if selection?.type == .category || selection?.type == .article { +// editorOpen = true +// } + } label: { + Image(systemName: "newspaper") + } + .help("Create a new topic") + } + + ToolbarItem { + Button { +// if selection?.type == .category || selection?.type == .article { +// editorOpen = true +// } + } label: { + Image(systemName: "tray") + } + .help("Create a new category") + } + + ToolbarItem { Button { loading = true if let selectionPath = selection?.path { @@ -120,7 +144,7 @@ struct NewsView: View { } label: { Image(systemName: "arrow.clockwise") } - .help("Reload News") + .help("Reload selected topic") .disabled(loading) } } @@ -265,22 +289,18 @@ struct NewsView: View { } } else { - HStack(alignment: .center) { - Spacer() - HStack(alignment: .center, spacing: 8) { -// Image(systemName: "doc.append") -// .resizable() -// .scaledToFit() + EmptyView() +// HStack(alignment: .center) { +// Spacer() +// HStack(alignment: .center, spacing: 8) { +// Text("Select a news article to read") // .foregroundStyle(.tertiary) -// .frame(width: 16, height: 16) - Text("Select a news post to read") - .foregroundStyle(.tertiary) - .font(.system(size: 13)) - } - Spacer() - } - .padding() - .padding(.top, 48) +// .font(.subheadline) +// } +// Spacer() +// } +// .padding() +// .padding(.top, 48) } } .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading) -- cgit