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