Increase the size of too-small favicons to 16x16 in the feed inspector.
This commit is contained in:
parent
e50055632b
commit
bb08cfaa5b
@ -81,16 +81,25 @@ private extension FeedInspectorViewController {
|
|||||||
|
|
||||||
func updateImage() {
|
func updateImage() {
|
||||||
|
|
||||||
guard let feed = feed, let image = image(for: feed) else {
|
guard let feed = feed else {
|
||||||
imageView?.image = nil
|
imageView?.image = nil
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
imageView?.image = image
|
|
||||||
}
|
|
||||||
|
|
||||||
func image(for feed: Feed) -> NSImage? {
|
if let feedIcon = appDelegate.feedIconDownloader.icon(for: feed) {
|
||||||
|
imageView?.image = feedIcon
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if let favicon = appDelegate.faviconDownloader.favicon(for: feed) {
|
||||||
|
if favicon.size.height < 16.0 && favicon.size.width < 16.0 {
|
||||||
|
favicon.size = NSSize(width: 16, height: 16)
|
||||||
|
}
|
||||||
|
imageView?.image = favicon
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
return appDelegate.feedIconDownloader.icon(for: feed) ?? appDelegate.faviconDownloader.favicon(for: feed)
|
imageView?.image = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateName() {
|
func updateName() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user