NetNewsWire/Shared/Data/SmallIconProvider.swift

44 lines
742 B
Swift
Raw Normal View History

//
// SmallIconProvider.swift
2018-08-29 07:18:24 +02:00
// NetNewsWire
//
// Created by Brent Simmons on 12/16/17.
// Copyright © 2017 Ranchero Software. All rights reserved.
//
import Foundation
import Articles
import Account
import RSCore
protocol SmallIconProvider {
var smallIcon: RSImage? { get }
}
extension Feed: SmallIconProvider {
var smallIcon: RSImage? {
if let image = appDelegate.faviconDownloader.favicon(for: self) {
return image
}
#if os(macOS)
return AppImages.genericFeedImage
#else
return FaviconGenerator.favicon(self)
#endif
}
}
extension Folder: SmallIconProvider {
var smallIcon: RSImage? {
#if os(macOS)
return RSImage(named: NSImage.folderName)
#else
return AppAssets.masterFolderImage
#endif
}
}