@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user