closed #60
This commit is contained in:
Trey t
2022-02-04 16:49:56 -06:00
parent b3785fac2c
commit a1f70edec2
10 changed files with 150 additions and 29 deletions

View File

@@ -22,19 +22,22 @@ struct SettingsView: View {
@AppStorage(UserDefaultsStore.Keys.useCloudKit.rawValue, store: GroupUserDefaults.groupDefaults) private var useCloudKit = false
@AppStorage(UserDefaultsStore.Keys.deleteEnable.rawValue, store: GroupUserDefaults.groupDefaults) private var deleteEnabled = true
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
var body: some View {
ZStack {
Color(UIColor.secondarySystemBackground)
Color(theme.secondaryBGColor)
VStack {
closeButtonView
.padding()
Group {
closeButtonView
.padding()
cloudKitEnable
addTestDataCell
clearDB
changeIcon
themePicker
showOnboardingButton
whyBackgroundMode
specialThanksCell
@@ -247,6 +250,34 @@ struct SettingsView: View {
.fixedSize(horizontal: false, vertical: true)
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
}
private var themePicker: some View {
ZStack {
Color(UIColor.systemBackground)
VStack {
Text(String(localized: "settings_background_title"))
HStack {
Spacer()
ForEach(Theme.allCases, id:\.rawValue) { aTheme in
Button(action: {
theme = aTheme
print(theme)
}, label: {
VStack {
aTheme.preview
Text(aTheme.title)
}
})
Spacer()
}
}
.padding(.top)
}
.padding()
}
.fixedSize(horizontal: false, vertical: true)
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
}
}
struct SettingsView_Previews: PreviewProvider {