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.
|
|
|
|
//
|
|
|
|
|
2019-04-15 22:03:05 +02:00
|
|
|
import Foundation
|
2018-07-24 03:29:08 +02:00
|
|
|
import Articles
|
2018-02-18 06:08:36 +01:00
|
|
|
import Account
|
2019-04-15 22:03:05 +02:00
|
|
|
import RSCore
|
2017-12-17 19:48:55 +01:00
|
|
|
|
|
|
|
protocol SmallIconProvider {
|
|
|
|
|
2019-11-06 01:05:57 +01:00
|
|
|
var smallIcon: IconImage? { get }
|
2017-12-17 19:48:55 +01:00
|
|
|
}
|
2018-02-18 06:08:36 +01:00
|
|
|
|
2019-11-16 19:02:58 +01:00
|
|
|
extension Account: SmallIconProvider {
|
|
|
|
var smallIcon: IconImage? {
|
|
|
|
if let image = AppAssets.image(for: type) {
|
|
|
|
return IconImage(image)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-26 06:41:18 +01:00
|
|
|
extension Feed: SmallIconProvider {
|
2018-02-18 06:08:36 +01:00
|
|
|
|
2019-11-06 01:05:57 +01:00
|
|
|
var smallIcon: IconImage? {
|
|
|
|
if let iconImage = appDelegate.faviconDownloader.favicon(for: self) {
|
|
|
|
return iconImage
|
2018-02-18 06:08:36 +01:00
|
|
|
}
|
2019-04-29 14:07:57 +02:00
|
|
|
return FaviconGenerator.favicon(self)
|
2018-02-18 06:08:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extension Folder: SmallIconProvider {
|
2019-11-06 01:05:57 +01:00
|
|
|
var smallIcon: IconImage? {
|
2024-02-26 17:37:15 +01:00
|
|
|
AppAssets.folderImage
|
2018-02-18 06:08:36 +01:00
|
|
|
}
|
|
|
|
}
|