2017-12-17 10:48:55 -08:00
|
|
|
//
|
|
|
|
// SmallIconProvider.swift
|
2018-08-28 22:18:24 -07:00
|
|
|
// NetNewsWire
|
2017-12-17 10:48:55 -08:00
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 12/16/17.
|
|
|
|
// Copyright © 2017 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2019-04-15 15:03:05 -05:00
|
|
|
import Foundation
|
2018-07-23 18:29:08 -07:00
|
|
|
import Articles
|
2018-02-17 21:08:36 -08:00
|
|
|
import Account
|
2019-04-15 15:03:05 -05:00
|
|
|
import RSCore
|
2017-12-17 10:48:55 -08:00
|
|
|
|
|
|
|
protocol SmallIconProvider {
|
|
|
|
|
2019-04-15 15:03:05 -05:00
|
|
|
var smallIcon: RSImage? { get }
|
2017-12-17 10:48:55 -08:00
|
|
|
}
|
2018-02-17 21:08:36 -08:00
|
|
|
|
|
|
|
extension Feed: SmallIconProvider {
|
|
|
|
|
2019-04-15 15:03:05 -05:00
|
|
|
var smallIcon: RSImage? {
|
2018-02-17 21:08:36 -08:00
|
|
|
if let image = appDelegate.faviconDownloader.favicon(for: self) {
|
|
|
|
return image
|
|
|
|
}
|
2019-04-15 15:03:05 -05:00
|
|
|
#if os(macOS)
|
2019-05-21 05:42:40 -05:00
|
|
|
return AppAssets.genericFeedImage
|
2019-04-15 15:03:05 -05:00
|
|
|
#else
|
2019-04-29 07:07:57 -05:00
|
|
|
return FaviconGenerator.favicon(self)
|
2019-04-15 15:03:05 -05:00
|
|
|
#endif
|
2018-02-17 21:08:36 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extension Folder: SmallIconProvider {
|
|
|
|
|
2019-04-15 15:03:05 -05:00
|
|
|
var smallIcon: RSImage? {
|
|
|
|
#if os(macOS)
|
|
|
|
return RSImage(named: NSImage.folderName)
|
|
|
|
#else
|
|
|
|
return AppAssets.masterFolderImage
|
|
|
|
#endif
|
2018-02-17 21:08:36 -08:00
|
|
|
}
|
2019-04-29 07:07:57 -05:00
|
|
|
|
2018-02-17 21:08:36 -08:00
|
|
|
}
|