Change to use Favicon generator.

This commit is contained in:
Maurice Parker 2019-11-12 15:36:03 -06:00
parent 0d2583948a
commit c366a55cb5
5 changed files with 3 additions and 14 deletions

View File

@ -16,12 +16,6 @@ extension NSImage.Name {
struct AppAssets {
static var genericFeedImage: IconImage? = {
let path = "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns"
let image = RSImage(contentsOfFile: path)
return image != nil ? IconImage(image!) : nil
}()
static var timelineStar: RSImage! = {
return RSImage(named: .timelineStar)
}()

View File

@ -119,7 +119,7 @@ private extension FeedInspectorViewController {
return
}
imageView?.image = AppAssets.genericFeedImage?.image
imageView?.image = feed.smallIcon?.image
}
func updateName() {

View File

@ -41,7 +41,7 @@ import RSCore
return nil
}
let image = sendToCommand.image ?? AppAssets.genericFeedImage?.image ?? NSImage()
let image = sendToCommand.image ?? NSImage()
return NSSharingService(title: sendToCommand.title, image: image, alternateImage: nil) {
sendToCommand.sendObject(object, selectedText: nil)
}

View File

@ -81,8 +81,7 @@ class SidebarCell : NSTableCellView {
}()
private let faviconImageView: NSImageView = {
let iconImage = AppAssets.genericFeedImage
let imageView = iconImage != nil ? NSImageView(image: iconImage!.image) : NSImageView(frame: NSRect.zero)
let imageView = NSImageView(frame: NSRect.zero)
imageView.animates = false
imageView.imageAlignment = .alignCenter
imageView.imageScaling = .scaleProportionallyDown

View File

@ -22,11 +22,7 @@ extension Feed: SmallIconProvider {
if let iconImage = appDelegate.faviconDownloader.favicon(for: self) {
return iconImage
}
#if os(macOS)
return AppAssets.genericFeedImage
#else
return FaviconGenerator.favicon(self)
#endif
}
}