closed #89 make custom widgets codable

This commit is contained in:
Trey t
2022-02-21 11:36:45 -06:00
parent bdfa780c22
commit 83060e8353
45 changed files with 679 additions and 130 deletions

View File

@@ -290,23 +290,11 @@ struct FeelsIconWidgetEntryView : View {
struct SmallIconView: View {
var entry: Provider.Entry
@AppStorage(UserDefaultsStore.Keys.customIcon.rawValue, store: GroupUserDefaults.groupDefaults) private var savedCustomIcon = Data()
var body: some View {
ZStack {
if let image = UIImage(data: savedCustomIcon) {
GeometryReader { geo in
Image(uiImage: image)
.resizable()
.scaledToFit()
}
} else {
GeometryReader { geo in
Mood.missing.graphic
.resizable()
.scaledToFit()
}
}
GeometryReader { geo in
CustomWidgetView(customWidgetModel: UserDefaultsStore.getCustomWidget())
.frame(width: geo.size.width, height: geo.size.height)
}
}
}