Commit 42a3851969
42a385196913dc8d1d9ee9a6ea134db4fa4cd546
parent: ea21f9ec4d
Verified · cmc
cmc <hello@cleberg.net> · 2026-10-14 13:59 UTC
Theme accent tints controls
Layout: unified · split
Sources/Orgstar/OrgstarApp.swift
+4
| @@ -337,6 +337,7 @@ struct OrgstarApp: App { |
| 337 | 337 | case .success(let model): |
| 338 | 338 | ContentView(workspace: model, session: session, commands: commands, scheduler: scheduler, clock: clock) |
| 339 | 339 | .environment(\.orgTheme, ConfigSync.shared.theme) |
| 340 | .tint(ConfigSync.shared.theme.color("accent")) |
| 340 | 341 | .onAppear { |
| 341 | 342 | delegate.session = session |
| 342 | 343 | delegate.commands = commands |
| @@ -351,6 +352,7 @@ struct OrgstarApp: App { |
| 351 | 352 | if case .success = workspace { |
| 352 | 353 | EditorWindowView(session: session, commands: commands, clock: clock) |
| 353 | 354 | .environment(\.orgTheme, ConfigSync.shared.theme) |
| 355 | .tint(ConfigSync.shared.theme.color("accent")) |
| 354 | 356 | } |
| 355 | 357 | } |
| 356 | 358 | .defaultSize(width: 900, height: 700) |
| @@ -359,6 +361,7 @@ struct OrgstarApp: App { |
| 359 | 361 | if case .success(let model) = workspace { |
| 360 | 362 | AgendaView(workspace: model, session: session, commands: commands, scheduler: scheduler, clock: clock) |
| 361 | 363 | .environment(\.orgTheme, ConfigSync.shared.theme) |
| 364 | .tint(ConfigSync.shared.theme.color("accent")) |
| 362 | 365 | } |
| 363 | 366 | } |
| 364 | 367 | .defaultSize(width: 760, height: 720) |
| @@ -366,6 +369,7 @@ struct OrgstarApp: App { |
| 366 | 369 | if case .success(let model) = workspace { |
| 367 | 370 | BoardView(workspace: model, session: session, commands: commands) |
| 368 | 371 | .environment(\.orgTheme, ConfigSync.shared.theme) |
| 372 | .tint(ConfigSync.shared.theme.color("accent")) |
| 369 | 373 | } |
| 370 | 374 | } |
| 371 | 375 | .defaultSize(width: 1100, height: 700) |
Sources/OrgstarMobile/MobileTheme.swift
+12
| @@ -153,4 +153,16 @@ struct MobileTheme { |
| 153 | 153 | /// A theme color for SwiftUI views. |
| 154 | 154 | func swiftColor(_ key: String) -> Color? { color(key).map { Color(uiColor: $0) } } |
| 155 | 155 | } |
| 156 | extension ThemeSpec { |
| 157 | /// `accent` for `.tint`, the system's blue in an appearance the theme leaves it unset; nil |
| 158 | /// when neither appearance sets it. |
| 159 | var accentColor: Color? { |
| 160 | let (light, dark) = (light["accent"], dark["accent"]) |
| 161 | guard light != nil || dark != nil else { return nil } |
| 162 | return Color(uiColor: UIColor { traits in |
| 163 | guard let c = traits.userInterfaceStyle == .dark ? dark : light else { return .systemBlue } |
| 164 | return UIColor(red: c.red, green: c.green, blue: c.blue, alpha: c.alpha) |
| 165 | }) |
| 166 | } |
| 167 | } |
| 156 | 168 | #endif |
Sources/OrgstarMobile/OrgstarMobileApp.swift
+1
| @@ -190,6 +190,7 @@ struct RootView: View { |
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | .clockAccessory(model.clock, perform: clock) |
| 193 | .tint(model.theme.accentColor) |
| 193 | 194 | // Until a folder is added there is nothing for the agenda to show. |
| 194 | 195 | .onAppear { if workspace.rootPaths.isEmpty { tab = .folders } } |
| 195 | 196 | .sheet(item: Binding(get: { model.clockPrompts.pending }, set: { if $0 == nil { model.clockPrompts.answer(nil) } })) { pending in |