summaryrefslogtreecommitdiff
path: root/Hutch/Views/Settings
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-12 19:47:57 -0500
committerChristian Cleberg <[email protected]>2026-04-12 19:47:57 -0500
commit1354f2464180ece6d13296a543a964ddf6d2d393 (patch)
tree5cf6ddb89c950941067e2a1080a150911d5fb4e7 /Hutch/Views/Settings
parent4ad1b74c5887ddf0445fde29ffacfc6eb5d49b3f (diff)
downloadhutch-1354f2464180ece6d13296a543a964ddf6d2d393.tar.gz
hutch-1354f2464180ece6d13296a543a964ddf6d2d393.tar.bz2
hutch-1354f2464180ece6d13296a543a964ddf6d2d393.zip
feat: add theme and high-density display modes
Refs: https://todo.sr.ht/~ccleberg/hutch/24 Implements: https://todo.sr.ht/~ccleberg/hutch/25
Diffstat (limited to 'Hutch/Views/Settings')
-rw-r--r--Hutch/Views/Settings/SettingsView.swift25
1 files changed, 25 insertions, 0 deletions
diff --git a/Hutch/Views/Settings/SettingsView.swift b/Hutch/Views/Settings/SettingsView.swift
index 4fb3f9c..5abac90 100644
--- a/Hutch/Views/Settings/SettingsView.swift
+++ b/Hutch/Views/Settings/SettingsView.swift
@@ -2,16 +2,20 @@ import SwiftUI
struct SettingsView: View {
@Environment(AppState.self) private var appState
+ @AppStorage(AppStorageKeys.appTheme) private var appTheme: AppTheme = .system
+ @AppStorage(AppStorageKeys.displayDensity) private var displayDensity: DisplayDensity = .standard
@AppStorage(AppStorageKeys.swipeActionsEnabled) private var swipeActionsEnabled = true
@AppStorage(AppStorageKeys.contributionGraphsEnabled) private var contributionGraphsEnabled = true
@State private var pendingDestructiveAction: SettingsDestructiveAction?
var body: some View {
Form {
+ appearanceSection()
behaviorSection()
authenticationSection()
aboutSection()
}
+ .themedList()
.navigationTitle("Settings")
.alert(
pendingDestructiveAction?.title ?? "",
@@ -45,6 +49,26 @@ struct SettingsView: View {
}
@ViewBuilder
+ private func appearanceSection() -> some View {
+ Section {
+ Picker("Theme", selection: $appTheme) {
+ ForEach(AppTheme.allCases) { theme in
+ Text(theme.label).tag(theme)
+ }
+ }
+ Picker("Density", selection: $displayDensity) {
+ ForEach(DisplayDensity.allCases) { density in
+ Text(density.label).tag(density)
+ }
+ }
+ } header: {
+ Text("Appearance")
+ } footer: {
+ Text("Compact density reduces spacing throughout the app.")
+ }
+ }
+
+ @ViewBuilder
private func behaviorSection() -> some View {
Section {
Toggle("Swipe actions", isOn: $swipeActionsEnabled)
@@ -192,6 +216,7 @@ private struct AboutView: View {
.foregroundStyle(.secondary)
}
}
+ .themedList()
.navigationTitle("About")
.navigationBarTitleDisplayMode(.inline)
}