NetNewsWire/Evergreen/Data/SmallIconProvider.swift
2018-02-17 21:08:36 -08:00

34 lines
574 B
Swift

//
// SmallIconProvider.swift
// Evergreen
//
// Created by Brent Simmons on 12/16/17.
// Copyright © 2017 Ranchero Software. All rights reserved.
//
import AppKit
import Data
import Account
protocol SmallIconProvider {
var smallIcon: NSImage? { get }
}
extension Feed: SmallIconProvider {
var smallIcon: NSImage? {
if let image = appDelegate.faviconDownloader.favicon(for: self) {
return image
}
return AppImages.genericFeedImage
}
}
extension Folder: SmallIconProvider {
var smallIcon: NSImage? {
return NSImage(named: NSImage.Name.folder)
}
}