WIP - custom widget creator

This commit is contained in:
Trey t
2022-02-13 13:34:41 -06:00
parent adcdf636c3
commit 1e7199337f
13 changed files with 457 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ struct SettingsView: View {
@State private var showSpecialThanks = false
@State private var showWhyBGMode = false
@State private var showCreateCustomWidget = false
@ObservedObject var syncMonitor = SyncMonitor.shared
@AppStorage(UserDefaultsStore.Keys.useCloudKit.rawValue, store: GroupUserDefaults.groupDefaults) private var useCloudKit = false
@@ -35,6 +36,7 @@ struct SettingsView: View {
canDelete
changeIcon
themePicker
createCustomWidget
showOnboardingButton
whyBackgroundMode
specialThanksCell
@@ -58,6 +60,9 @@ struct SettingsView: View {
showOnboarding = false
})
}
.sheet(isPresented: $showCreateCustomWidget) {
CreateIconView()
}
.background(
theme.currentTheme.bg
.edgesIgnoringSafeArea(.all)
@@ -283,6 +288,20 @@ struct SettingsView: View {
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(10, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
}
private var createCustomWidget: some View {
ZStack {
Color(theme.currentTheme.secondaryBGColor)
Button(action: {
showCreateCustomWidget = true
}, label: {
Text("Create Custom Widget")
})
.padding()
}
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(10, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
}
}
struct SettingsView_Previews: PreviewProvider {