Add dark mode support with appearance picker and fix hardcoded colors

Add user-facing appearance setting (System/Light/Dark) wired via
preferredColorScheme at the app root. Replace hardcoded .black tints
and foreground styles with .primary so toolbar buttons and text remain
visible in dark mode. Remove profile picture from settings and
SwiftSoup from acknowledgements.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 06:31:14 +01:00
parent c38d4075be
commit 02118e3d7a
12 changed files with 177 additions and 53 deletions

View File

@@ -13,7 +13,16 @@ import SwiftUI
struct Nextcloud_Cookbook_iOS_ClientApp: App {
@AppStorage("onboarding") var onboarding = true
@AppStorage("language") var language = Locale.current.language.languageCode?.identifier ?? "en"
@AppStorage("appearanceMode") var appearanceMode = AppearanceMode.system.rawValue
var colorScheme: ColorScheme? {
switch appearanceMode {
case AppearanceMode.light.rawValue: return .light
case AppearanceMode.dark.rawValue: return .dark
default: return nil
}
}
var body: some Scene {
WindowGroup {
ZStack {
@@ -23,6 +32,7 @@ struct Nextcloud_Cookbook_iOS_ClientApp: App {
MainView()
}
}
.preferredColorScheme(colorScheme)
.transition(.slide)
.environment(
\.locale,