aboutsummaryrefslogtreecommitdiff
path: root/Hotline
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2025-11-17 11:48:02 -0800
committerDustin Mierau <dustin@mierau.me>2025-11-17 11:48:17 -0800
commit6a95b53616a4abfa306ddce43151cf4fefbd20ed (patch)
treeb1352fa11539f18fb4d6e0d5b6fc46cecb437662 /Hotline
parent7b86c071727e35573d06fa43d72e169d8f468d67 (diff)
New macOS 26 app icon. Prepping NewsView for category/topic management.
Diffstat (limited to 'Hotline')
-rw-r--r--Hotline/Assets/App Icon.icon/Assets/hl.svg3
-rw-r--r--Hotline/Assets/App Icon.icon/icon.json49
-rw-r--r--Hotline/macOS/News/NewsView.swift96
3 files changed, 110 insertions, 38 deletions
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 @@
+<svg width="292" height="524" viewBox="0 0 292 524" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M0 72.2197C0 66.5834 2.71083 61.294 7.27848 58.018L86.34 1.31264C90.9415 -1.98774 97.3333 1.31516 97.3333 6.99335V206.35H194.667V73.7098C194.667 67.9266 199.336 63.2383 205.095 63.2383L281.571 63.2383C287.331 63.2383 292 67.9266 292 73.7099L292 448.941C292 454.434 289.424 459.607 285.048 462.903L205.79 522.591C201.207 526.043 194.667 522.759 194.667 517.006V315.04L97.3333 314.717V450.686C97.3333 456.47 92.6643 461.158 86.9048 461.158H10.4286C4.66903 461.158 0 456.47 0 450.686V72.2197Z" fill="white"/>
+</svg>
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)