Merge pull request #3347 from stuartbreckenridge/widget-icons
Resolves partial widget images
This commit is contained in:
commit
c82678644c
|
@ -13,15 +13,18 @@ struct ArticleItemView: View {
|
||||||
|
|
||||||
var article: LatestArticle
|
var article: LatestArticle
|
||||||
var deepLink: URL
|
var deepLink: URL
|
||||||
|
@State private var iconImage: UIImage?
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Link(destination: deepLink, label: {
|
Link(destination: deepLink, label: {
|
||||||
HStack(alignment: .top, spacing: nil, content: {
|
HStack(alignment: .top, spacing: nil, content: {
|
||||||
// Feed Icon
|
// Feed Icon
|
||||||
Image(uiImage: thumbnail(article.feedIcon))
|
if iconImage != nil {
|
||||||
|
Image(uiImage: iconImage!)
|
||||||
.resizable()
|
.resizable()
|
||||||
.frame(width: 30, height: 30)
|
.frame(width: 30, height: 30)
|
||||||
.cornerRadius(4)
|
.cornerRadius(4)
|
||||||
|
}
|
||||||
|
|
||||||
// Title and Feed Name
|
// Title and Feed Name
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
|
@ -45,7 +48,9 @@ struct ArticleItemView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
}).onAppear {
|
||||||
|
iconImage = thumbnail(article.feedIcon)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func thumbnail(_ data: Data?) -> UIImage {
|
func thumbnail(_ data: Data?) -> UIImage {
|
||||||
|
|
Loading…
Reference in New Issue