2017-12-17 19:48:55 +01:00
|
|
|
//
|
|
|
|
// SmallIconProvider.swift
|
2018-08-29 07:18:24 +02:00
|
|
|
// NetNewsWire
|
2017-12-17 19:48:55 +01:00
|
|
|
//
|
|
|
|
// 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-07-24 03:29:08 +02:00
|
|
|
import Articles
|
2018-02-18 06:08:36 +01:00
|
|
|
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? {
|
2018-12-09 21:32:33 +01:00
|
|
|
return NSImage(named: NSImage.folderName)
|
2018-02-18 06:08:36 +01:00
|
|
|
}
|
|
|
|
}
|