add shape picker for backgrounds

This commit is contained in:
Trey t
2022-03-20 02:45:51 -05:00
parent d064cdb3d9
commit 36a688084c
14 changed files with 247 additions and 91 deletions

View File

@@ -15,6 +15,8 @@ struct MonthView: View {
@AppStorage(UserDefaultsStore.Keys.moodTint.rawValue, store: GroupUserDefaults.groupDefaults) private var moodTint: MoodTints = .Default
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = .black
@AppStorage(UserDefaultsStore.Keys.shape.rawValue, store: GroupUserDefaults.groupDefaults) private var shape: BGShape = .circle
@StateObject private var shareImage = StupidAssShareObservableObject()
// store a value that gets changed when user updates custom colors to update the view since the moodTint doesn't change
@@ -155,9 +157,9 @@ extension MonthView {
Divider()
LazyVGrid(columns: columns, spacing: 15) {
ForEach(entries, id: \.self) { entry in
Circle()
.foregroundColor(entry.mood == .placeholder ? .clear : moodTint.color(forMood: entry.mood))
.frame(minHeight: 5, idealHeight: 20, maxHeight: 50, alignment: .center)
shape.view(withText: Text(""), bgColor: entry.mood == .placeholder ? .clear : moodTint.color(forMood: entry.mood),
textColor: .clear)
.frame(minHeight: 5, idealHeight: 20, maxHeight: 50, alignment: .center)
}
}
Spacer()
@@ -194,11 +196,11 @@ extension MonthView {
}
}
Divider()
LazyVGrid(columns: columns, spacing: 15) {
LazyVGrid(columns: columns, spacing: 25) {
ForEach(entries, id: \.self) { entry in
Circle()
.foregroundColor(entry.mood == .placeholder ? .clear : moodTint.color(forMood: entry.mood))
.frame(minHeight: 5, idealHeight: 20, maxHeight: 50, alignment: .center)
shape.view(withText: Text(""), bgColor: entry.mood == .placeholder ? .clear : moodTint.color(forMood: entry.mood),
textColor: .clear)
.frame(minHeight: 5, idealHeight: 20, maxHeight: 50, alignment: .center)
}
}
}