aboutsummaryrefslogtreecommitdiff
path: root/Hotline/macOS
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2025-10-28 09:33:19 -0700
committerDustin Mierau <dustin@mierau.me>2025-10-28 09:33:19 -0700
commitd23d0ad9405c1622569415e6ce16d3768af2936a (patch)
tree13b1f3ba43367d9b53383c1d5e90eb8959d158e1 /Hotline/macOS
parentd8a10c38a3c26a187d8f310eba56d4e9ca8c5b27 (diff)
New default banner artwork. Theme toolbar to server's banner (if any).
Diffstat (limited to 'Hotline/macOS')
-rw-r--r--Hotline/macOS/Chat/ChatView.swift3
-rw-r--r--Hotline/macOS/HotlinePanelView.swift25
2 files changed, 19 insertions, 9 deletions
diff --git a/Hotline/macOS/Chat/ChatView.swift b/Hotline/macOS/Chat/ChatView.swift
index 65087c6..0795856 100644
--- a/Hotline/macOS/Chat/ChatView.swift
+++ b/Hotline/macOS/Chat/ChatView.swift
@@ -192,8 +192,9 @@ struct ChatView: View {
model.markPublicChatAsRead()
}
.onAppear {
- reader.scrollTo(bottomID, anchor: .bottom)
self.focusedField = .chatInput
+ model.markPublicChatAsRead()
+ reader.scrollTo(bottomID, anchor: .bottom)
}
.onChange(of: self.model.bannerImage) {
reader.scrollTo(bottomID, anchor: .bottom)
diff --git a/Hotline/macOS/HotlinePanelView.swift b/Hotline/macOS/HotlinePanelView.swift
index fd43c15..4ae4924 100644
--- a/Hotline/macOS/HotlinePanelView.swift
+++ b/Hotline/macOS/HotlinePanelView.swift
@@ -3,7 +3,14 @@ import SwiftUI
struct HotlinePanelView: View {
@Environment(\.openWindow) var openWindow
@Environment(\.colorScheme) var colorScheme
-
+
+ private var colorArt: ColorArt? {
+ if let banner = AppState.shared.activeServerBanner {
+ return ColorArt(image: banner, scaledSize: NSSize(width: 100, height: 100))
+ }
+ return nil
+ }
+
var body: some View {
VStack(spacing: 0) {
Image(nsImage: AppState.shared.activeServerBanner ?? NSImage(named: "Default Banner")!)
@@ -34,7 +41,7 @@ struct HotlinePanelView: View {
.buttonStyle(.plain)
.frame(width: 20, height: 20)
.help("Hotline Servers")
-
+
Button {
AppState.shared.activeServerState?.selection = .chat
}
@@ -47,7 +54,7 @@ struct HotlinePanelView: View {
.frame(width: 20, height: 20)
.disabled(AppState.shared.activeServerState == nil)
.help("Public Chat")
-
+
Button {
AppState.shared.activeServerState?.selection = .board
}
@@ -60,7 +67,7 @@ struct HotlinePanelView: View {
.frame(width: 20, height: 20)
.disabled(AppState.shared.activeServerState == nil)
.help("Message Board")
-
+
Button {
AppState.shared.activeServerState?.selection = .news
}
@@ -73,7 +80,7 @@ struct HotlinePanelView: View {
.frame(width: 20, height: 20)
.disabled(AppState.shared.activeServerState == nil || (AppState.shared.activeHotline?.serverVersion ?? 0) < 151)
.help("News")
-
+
Button {
AppState.shared.activeServerState?.selection = .files
}
@@ -86,9 +93,9 @@ struct HotlinePanelView: View {
.frame(width: 20, height: 20)
.disabled(AppState.shared.activeServerState == nil)
.help("Files")
-
+
Spacer()
-
+
if AppState.shared.activeHotline?.access?.contains(.canOpenUsers) == true {
Button {
AppState.shared.activeServerState?.selection = .accounts
@@ -103,7 +110,7 @@ struct HotlinePanelView: View {
.disabled(AppState.shared.activeServerState == nil)
.help("Accounts")
}
-
+
SettingsLink(label: {
Image("Section Settings")
.resizable()
@@ -116,6 +123,8 @@ struct HotlinePanelView: View {
.padding(.top, 12)
.padding(.bottom, 12)
.padding([.leading, .trailing], 12)
+ .background(colorArt.map { Color(nsColor: $0.backgroundColor) } ?? Color(nsColor: .controlBackgroundColor))
+ .foregroundStyle(colorArt.map { Color(nsColor: $0.primaryColor) } ?? Color.primary)
// .background(Color.red.opacity(0.5).blendMode(.multiply))
// GroupBox {