closed #69
This commit is contained in:
@@ -264,7 +264,6 @@
|
|||||||
1CAD602C27A5C1C800C520BD /* SettingsView.swift */,
|
1CAD602C27A5C1C800C520BD /* SettingsView.swift */,
|
||||||
1CAD602B27A5C1C800C520BD /* SmallRollUpHeaderView.swift */,
|
1CAD602B27A5C1C800C520BD /* SmallRollUpHeaderView.swift */,
|
||||||
1CAD603D27A6ECCD00C520BD /* SwitchableView.swift */,
|
1CAD603D27A6ECCD00C520BD /* SwitchableView.swift */,
|
||||||
1C358FAC27ADD0C3002C83A6 /* Theme.swift */,
|
|
||||||
);
|
);
|
||||||
path = Views;
|
path = Views;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -370,12 +369,13 @@
|
|||||||
1CD90B60278C7EBA001C4FEA /* Models */ = {
|
1CD90B60278C7EBA001C4FEA /* Models */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
1C5F4977279C945E0092F1B4 /* UserDefaultsStore.swift */,
|
|
||||||
1CA0376F2799FFA600D26164 /* ContentModeViewModel.swift */,
|
1CA0376F2799FFA600D26164 /* ContentModeViewModel.swift */,
|
||||||
1CC469AB27907D48003E0C6E /* DayChartView.swift */,
|
1CC469AB27907D48003E0C6E /* DayChartView.swift */,
|
||||||
|
1C2618FD27960A4F00FDC148 /* FilterViewModel.swift */,
|
||||||
1CD90B61278C7EBA001C4FEA /* Mood.swift */,
|
1CD90B61278C7EBA001C4FEA /* Mood.swift */,
|
||||||
1CD90B62278C7EBA001C4FEA /* MoodEntryExtension.swift */,
|
1CD90B62278C7EBA001C4FEA /* MoodEntryExtension.swift */,
|
||||||
1C2618FD27960A4F00FDC148 /* FilterViewModel.swift */,
|
1C358FAC27ADD0C3002C83A6 /* Theme.swift */,
|
||||||
|
1C5F4977279C945E0092F1B4 /* UserDefaultsStore.swift */,
|
||||||
);
|
);
|
||||||
path = Models;
|
path = Models;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
|||||||
@@ -25,36 +25,32 @@ struct SettingsView: View {
|
|||||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
ScrollView {
|
||||||
Color(theme.secondaryBGColor)
|
VStack {
|
||||||
ScrollView {
|
Group {
|
||||||
VStack {
|
closeButtonView
|
||||||
Group {
|
.padding()
|
||||||
closeButtonView
|
|
||||||
.padding()
|
|
||||||
|
|
||||||
cloudKitEnable
|
|
||||||
canDelete
|
|
||||||
changeIcon
|
|
||||||
themePicker
|
|
||||||
showOnboardingButton
|
|
||||||
whyBackgroundMode
|
|
||||||
specialThanksCell
|
|
||||||
}
|
|
||||||
|
|
||||||
Group {
|
cloudKitEnable
|
||||||
addTestDataCell
|
canDelete
|
||||||
clearDB
|
changeIcon
|
||||||
|
themePicker
|
||||||
if useCloudKit {
|
showOnboardingButton
|
||||||
cloudKitStatus
|
whyBackgroundMode
|
||||||
}
|
specialThanksCell
|
||||||
}
|
|
||||||
Spacer()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Group {
|
||||||
|
addTestDataCell
|
||||||
|
clearDB
|
||||||
|
|
||||||
|
if useCloudKit {
|
||||||
|
cloudKitStatus
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
|
|
||||||
}.sheet(isPresented: $showOnboarding) {
|
}.sheet(isPresented: $showOnboarding) {
|
||||||
OnboardingMain(onboardingData: UserDefaultsStore.getOnboarding(),
|
OnboardingMain(onboardingData: UserDefaultsStore.getOnboarding(),
|
||||||
updateBoardingDataClosure: { onboardingData in
|
updateBoardingDataClosure: { onboardingData in
|
||||||
@@ -62,7 +58,10 @@ struct SettingsView: View {
|
|||||||
showOnboarding = false
|
showOnboarding = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
.ignoresSafeArea()
|
.background(
|
||||||
|
theme.bg
|
||||||
|
.edgesIgnoringSafeArea(.all)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var closeButtonView: some View {
|
private var closeButtonView: some View {
|
||||||
@@ -80,7 +79,7 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
private var specialThanksCell: some View {
|
private var specialThanksCell: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
Color(UIColor.systemBackground)
|
Color(theme.secondaryBGColor)
|
||||||
VStack {
|
VStack {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
withAnimation{
|
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])
|
.cornerRadius(10, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
|
||||||
}
|
}
|
||||||
|
|
||||||
private var addTestDataCell: some View {
|
private var addTestDataCell: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
Color(UIColor.systemBackground)
|
Color(theme.secondaryBGColor)
|
||||||
Button(action: {
|
Button(action: {
|
||||||
PersistenceController.shared.populateTestData()
|
PersistenceController.shared.populateTestData()
|
||||||
editedDataClosure()
|
editedDataClosure()
|
||||||
@@ -118,7 +117,7 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
private var clearDB: some View {
|
private var clearDB: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
Color(UIColor.systemBackground)
|
Color(theme.secondaryBGColor)
|
||||||
Button(action: {
|
Button(action: {
|
||||||
PersistenceController.shared.clearDB()
|
PersistenceController.shared.clearDB()
|
||||||
editedDataClosure()
|
editedDataClosure()
|
||||||
@@ -133,7 +132,7 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
private var whyBackgroundMode: some View {
|
private var whyBackgroundMode: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
Color(UIColor.systemBackground)
|
Color(theme.secondaryBGColor)
|
||||||
VStack {
|
VStack {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
withAnimation{
|
withAnimation{
|
||||||
@@ -160,7 +159,7 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
private var changeIcon: some View {
|
private var changeIcon: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
Color(UIColor.systemBackground)
|
Color(theme.secondaryBGColor)
|
||||||
VStack {
|
VStack {
|
||||||
Text(String(localized: "settings_view_change_icon"))
|
Text(String(localized: "settings_view_change_icon"))
|
||||||
HStack {
|
HStack {
|
||||||
@@ -197,7 +196,7 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
private var showOnboardingButton: some View {
|
private var showOnboardingButton: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
Color(UIColor.systemBackground)
|
Color(theme.secondaryBGColor)
|
||||||
Button(action: {
|
Button(action: {
|
||||||
showOnboarding.toggle()
|
showOnboarding.toggle()
|
||||||
}, label: {
|
}, label: {
|
||||||
@@ -211,7 +210,7 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
private var cloudKitEnable: some View {
|
private var cloudKitEnable: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
Color(UIColor.systemBackground)
|
Color(theme.secondaryBGColor)
|
||||||
VStack {
|
VStack {
|
||||||
Toggle(String(localized: "settings_use_cloudkit_title"),
|
Toggle(String(localized: "settings_use_cloudkit_title"),
|
||||||
isOn: $useCloudKit)
|
isOn: $useCloudKit)
|
||||||
@@ -229,7 +228,7 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
private var cloudKitStatus: some View {
|
private var cloudKitStatus: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
Color(UIColor.systemBackground)
|
Color(theme.secondaryBGColor)
|
||||||
VStack {
|
VStack {
|
||||||
Image(systemName: syncMonitor.syncStateSummary.symbolName)
|
Image(systemName: syncMonitor.syncStateSummary.symbolName)
|
||||||
.foregroundColor(syncMonitor.syncStateSummary.symbolColor)
|
.foregroundColor(syncMonitor.syncStateSummary.symbolColor)
|
||||||
@@ -243,7 +242,7 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
private var canDelete: some View {
|
private var canDelete: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
Color(UIColor.systemBackground)
|
Color(theme.secondaryBGColor)
|
||||||
VStack {
|
VStack {
|
||||||
Toggle(String(localized: "settings_use_delete_enable"),
|
Toggle(String(localized: "settings_use_delete_enable"),
|
||||||
isOn: $deleteEnabled)
|
isOn: $deleteEnabled)
|
||||||
@@ -256,7 +255,7 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
private var themePicker: some View {
|
private var themePicker: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
Color(UIColor.systemBackground)
|
Color(theme.secondaryBGColor)
|
||||||
VStack {
|
VStack {
|
||||||
Text(String(localized: "settings_background_title"))
|
Text(String(localized: "settings_background_title"))
|
||||||
HStack {
|
HStack {
|
||||||
@@ -267,6 +266,10 @@ struct SettingsView: View {
|
|||||||
}, label: {
|
}, label: {
|
||||||
VStack {
|
VStack {
|
||||||
aTheme.preview
|
aTheme.preview
|
||||||
|
.overlay(
|
||||||
|
Circle()
|
||||||
|
.stroke(Color(UIColor.systemGray), style: StrokeStyle(lineWidth: 2))
|
||||||
|
)
|
||||||
Text(aTheme.title)
|
Text(aTheme.title)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user