This commit is contained in:
Trey t
2022-02-06 12:15:42 -06:00
parent ca25ddffd5
commit ea8ce75058
3 changed files with 44 additions and 41 deletions

View File

@@ -264,7 +264,6 @@
1CAD602C27A5C1C800C520BD /* SettingsView.swift */,
1CAD602B27A5C1C800C520BD /* SmallRollUpHeaderView.swift */,
1CAD603D27A6ECCD00C520BD /* SwitchableView.swift */,
1C358FAC27ADD0C3002C83A6 /* Theme.swift */,
);
path = Views;
sourceTree = "<group>";
@@ -370,12 +369,13 @@
1CD90B60278C7EBA001C4FEA /* Models */ = {
isa = PBXGroup;
children = (
1C5F4977279C945E0092F1B4 /* UserDefaultsStore.swift */,
1CA0376F2799FFA600D26164 /* ContentModeViewModel.swift */,
1CC469AB27907D48003E0C6E /* DayChartView.swift */,
1C2618FD27960A4F00FDC148 /* FilterViewModel.swift */,
1CD90B61278C7EBA001C4FEA /* Mood.swift */,
1CD90B62278C7EBA001C4FEA /* MoodEntryExtension.swift */,
1C2618FD27960A4F00FDC148 /* FilterViewModel.swift */,
1C358FAC27ADD0C3002C83A6 /* Theme.swift */,
1C5F4977279C945E0092F1B4 /* UserDefaultsStore.swift */,
);
path = Models;
sourceTree = "<group>";

View File

@@ -25,36 +25,32 @@ struct SettingsView: View {
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
var body: some View {
ZStack {
Color(theme.secondaryBGColor)
ScrollView {
VStack {
Group {
closeButtonView
.padding()
cloudKitEnable
canDelete
changeIcon
themePicker
showOnboardingButton
whyBackgroundMode
specialThanksCell
}
ScrollView {
VStack {
Group {
closeButtonView
.padding()
Group {
addTestDataCell
clearDB
if useCloudKit {
cloudKitStatus
}
}
Spacer()
cloudKitEnable
canDelete
changeIcon
themePicker
showOnboardingButton
whyBackgroundMode
specialThanksCell
}
Group {
addTestDataCell
clearDB
if useCloudKit {
cloudKitStatus
}
}
Spacer()
}
.padding()
}.sheet(isPresented: $showOnboarding) {
OnboardingMain(onboardingData: UserDefaultsStore.getOnboarding(),
updateBoardingDataClosure: { onboardingData in
@@ -62,7 +58,10 @@ struct SettingsView: View {
showOnboarding = false
})
}
.ignoresSafeArea()
.background(
theme.bg
.edgesIgnoringSafeArea(.all)
)
}
private var closeButtonView: some View {
@@ -80,7 +79,7 @@ struct SettingsView: View {
private var specialThanksCell: some View {
ZStack {
Color(UIColor.systemBackground)
Color(theme.secondaryBGColor)
VStack {
Button(action: {
withAnimation{
@@ -97,13 +96,13 @@ struct SettingsView: View {
}
}
}
.fixedSize(horizontal: false, vertical: true)
.frame(minWidth: 0, maxWidth: .infinity)
.cornerRadius(10, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
}
private var addTestDataCell: some View {
ZStack {
Color(UIColor.systemBackground)
Color(theme.secondaryBGColor)
Button(action: {
PersistenceController.shared.populateTestData()
editedDataClosure()
@@ -118,7 +117,7 @@ struct SettingsView: View {
private var clearDB: some View {
ZStack {
Color(UIColor.systemBackground)
Color(theme.secondaryBGColor)
Button(action: {
PersistenceController.shared.clearDB()
editedDataClosure()
@@ -133,7 +132,7 @@ struct SettingsView: View {
private var whyBackgroundMode: some View {
ZStack {
Color(UIColor.systemBackground)
Color(theme.secondaryBGColor)
VStack {
Button(action: {
withAnimation{
@@ -160,7 +159,7 @@ struct SettingsView: View {
private var changeIcon: some View {
ZStack {
Color(UIColor.systemBackground)
Color(theme.secondaryBGColor)
VStack {
Text(String(localized: "settings_view_change_icon"))
HStack {
@@ -197,7 +196,7 @@ struct SettingsView: View {
private var showOnboardingButton: some View {
ZStack {
Color(UIColor.systemBackground)
Color(theme.secondaryBGColor)
Button(action: {
showOnboarding.toggle()
}, label: {
@@ -211,7 +210,7 @@ struct SettingsView: View {
private var cloudKitEnable: some View {
ZStack {
Color(UIColor.systemBackground)
Color(theme.secondaryBGColor)
VStack {
Toggle(String(localized: "settings_use_cloudkit_title"),
isOn: $useCloudKit)
@@ -229,7 +228,7 @@ struct SettingsView: View {
private var cloudKitStatus: some View {
ZStack {
Color(UIColor.systemBackground)
Color(theme.secondaryBGColor)
VStack {
Image(systemName: syncMonitor.syncStateSummary.symbolName)
.foregroundColor(syncMonitor.syncStateSummary.symbolColor)
@@ -243,7 +242,7 @@ struct SettingsView: View {
private var canDelete: some View {
ZStack {
Color(UIColor.systemBackground)
Color(theme.secondaryBGColor)
VStack {
Toggle(String(localized: "settings_use_delete_enable"),
isOn: $deleteEnabled)
@@ -256,7 +255,7 @@ struct SettingsView: View {
private var themePicker: some View {
ZStack {
Color(UIColor.systemBackground)
Color(theme.secondaryBGColor)
VStack {
Text(String(localized: "settings_background_title"))
HStack {
@@ -267,6 +266,10 @@ struct SettingsView: View {
}, label: {
VStack {
aTheme.preview
.overlay(
Circle()
.stroke(Color(UIColor.systemGray), style: StrokeStyle(lineWidth: 2))
)
Text(aTheme.title)
}
})