diff options
| author | Dustin Mierau <dustin@mierau.me> | 2025-10-28 10:06:33 -0700 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2025-10-28 10:06:33 -0700 |
| commit | c5165d348c1efbcc553b3c31dbeaa23353914fb6 (patch) | |
| tree | 6ba4121a34c095d1180d3025f59e5a300b533937 /Hotline/macOS/HotlinePanelView.swift | |
| parent | d23d0ad9405c1622569415e6ce16d3768af2936a (diff) | |
Some state cleanup and banner color caching in ServerState.
Diffstat (limited to 'Hotline/macOS/HotlinePanelView.swift')
| -rw-r--r-- | Hotline/macOS/HotlinePanelView.swift | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Hotline/macOS/HotlinePanelView.swift b/Hotline/macOS/HotlinePanelView.swift index 4ae4924..ee4d198 100644 --- a/Hotline/macOS/HotlinePanelView.swift +++ b/Hotline/macOS/HotlinePanelView.swift @@ -4,16 +4,9 @@ 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")!) + Image(nsImage: AppState.shared.activeServerState?.serverBanner ?? NSImage(named: "Default Banner")!) .interpolation(.high) .resizable() .scaledToFill() @@ -123,8 +116,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(AppState.shared.activeServerState?.bannerColors.map { Color(nsColor: $0.backgroundColor) } ?? Color(nsColor: .controlBackgroundColor)) + .foregroundStyle(AppState.shared.activeServerState?.bannerColors.map { Color(nsColor: $0.primaryColor) } ?? Color.primary) // .background(Color.red.opacity(0.5).blendMode(.multiply)) // GroupBox { |