2017-12-17 10:48:55 -08:00
|
|
|
//
|
|
|
|
// SmallIconProvider.swift
|
|
|
|
// Evergreen
|
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 12/16/17.
|
|
|
|
// Copyright © 2017 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2018-02-02 22:51:32 -08:00
|
|
|
import AppKit
|
2018-07-23 18:29:08 -07:00
|
|
|
import Articles
|
2018-02-17 21:08:36 -08:00
|
|
|
import Account
|
2017-12-17 10:48:55 -08:00
|
|
|
|
|
|
|
protocol SmallIconProvider {
|
|
|
|
|
|
|
|
var smallIcon: NSImage? { get }
|
|
|
|
}
|
2018-02-17 21:08:36 -08:00
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|