WIP - custom widget icon

This commit is contained in:
Trey t
2022-02-13 22:15:53 -06:00
parent 56d7e40c27
commit 649180dbb5
7 changed files with 372 additions and 250 deletions

View File

@@ -279,12 +279,23 @@ 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 {
GeometryReader { geo in
Mood.missing.graphic
.resizable()
.scaledToFit()
ZStack {
if let image = UIImage(data: savedCustomIcon) {
GeometryReader { geo in
Image(uiImage: image)
.resizable()
.scaledToFit()
}
} else {
GeometryReader { geo in
Mood.missing.graphic
.resizable()
.scaledToFit()
}
}
}
}
}