2020-06-28 10:05:01 +02:00
|
|
|
//
|
|
|
|
// AppAssets.swift
|
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 6/27/20.
|
|
|
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
import RSCore
|
|
|
|
import Account
|
|
|
|
|
|
|
|
struct AppAssets {
|
|
|
|
|
|
|
|
static var accountLocalMacImage: RSImage! = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "AccountLocalMac")
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
|
|
|
static var accountLocalPadImage: RSImage = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "AccountLocalPad")!
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
|
|
|
static var accountLocalPhoneImage: RSImage = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "AccountLocalPhone")!
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
|
|
|
static var accountCloudKitImage: RSImage = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "AccountCloudKit")!
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
|
|
|
static var accountFeedbinImage: RSImage = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "AccountFeedbin")!
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
|
|
|
static var accountFeedlyImage: RSImage = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "AccountFeedly")!
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
|
|
|
static var accountFeedWranglerImage: RSImage = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "AccountFeedWrangler")!
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
|
|
|
static var accountFreshRSSImage: RSImage = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "AccountFreshRSS")!
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
|
|
|
static var accountNewsBlurImage: RSImage = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "AccountNewsBlur")!
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
2020-07-04 02:19:40 +02:00
|
|
|
static var addMenuImage: Image = {
|
|
|
|
return Image(systemName: "plus")
|
|
|
|
}()
|
|
|
|
|
2020-06-28 10:05:01 +02:00
|
|
|
static var extensionPointMarsEdit: RSImage = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "ExtensionPointMarsEdit")!
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
|
|
|
static var extensionPointMicroblog: RSImage = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "ExtensionPointMicroblog")!
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
|
|
|
static var extensionPointReddit: RSImage = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "ExtensionPointReddit")!
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
|
|
|
static var extensionPointTwitter: RSImage = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "ExtensionPointTwitter")!
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
|
|
|
static var faviconTemplateImage: RSImage = {
|
2020-07-04 02:19:40 +02:00
|
|
|
return RSImage(named: "FaviconTemplateImage")!
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
2020-07-04 02:19:40 +02:00
|
|
|
static var settingsImage: Image = {
|
|
|
|
return Image(systemName: "gear")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var masterFolderImage: IconImage {
|
2020-06-28 10:05:01 +02:00
|
|
|
#if os(macOS)
|
2020-07-04 02:19:40 +02:00
|
|
|
let image = NSImage(systemSymbolName: "folder.fill", accessibilityDescription: nil)!
|
|
|
|
let coloredImage = image.tinted(with: NSColor(named: "AccentColor")!)
|
|
|
|
return IconImage(coloredImage)
|
2020-06-28 10:05:01 +02:00
|
|
|
#endif
|
|
|
|
#if os(iOS)
|
2020-07-04 02:19:40 +02:00
|
|
|
let image = UIImage(systemName: "folder.fill")!
|
|
|
|
let coloredImage = image.tinted(color: UIColor(named: "AccentColor")!)!
|
|
|
|
return IconImage(coloredImage)
|
2020-06-28 10:05:01 +02:00
|
|
|
#endif
|
2020-07-04 02:19:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static var markAllAsReadImage: Image = {
|
|
|
|
return Image("MarkAllAsRead")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var markAllAsReadImagePDF: Image = {
|
|
|
|
return Image("MarkAllAsReadPDF")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var nextUnreadArticleImage: Image = {
|
|
|
|
return Image(systemName: "chevron.down.circle")
|
2020-06-28 10:05:01 +02:00
|
|
|
}()
|
|
|
|
|
2020-07-04 02:19:40 +02:00
|
|
|
static var openInBrowserImage: Image = {
|
|
|
|
return Image(systemName: "safari")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var refreshImage: Image = {
|
|
|
|
return Image(systemName: "arrow.clockwise")
|
|
|
|
}()
|
|
|
|
|
2020-06-28 10:05:01 +02:00
|
|
|
static var searchFeedImage: IconImage = {
|
|
|
|
#if os(macOS)
|
|
|
|
return IconImage(NSImage(systemSymbolName: "magnifyingglass", accessibilityDescription: nil)!)
|
|
|
|
#endif
|
|
|
|
#if os(iOS)
|
|
|
|
return IconImage(UIImage(systemName: "magnifyingglass")!)
|
|
|
|
#endif
|
|
|
|
}()
|
|
|
|
|
2020-07-04 02:41:38 +02:00
|
|
|
static var sidebarUnreadCountBackground: Color = {
|
|
|
|
return Color("SidebarUnreadCountBackground")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var sidebarUnreadCountForeground: Color = {
|
|
|
|
return Color("SidebarUnreadCountForeground")
|
|
|
|
}()
|
|
|
|
|
2020-07-04 02:19:40 +02:00
|
|
|
static var shareImage: Image = {
|
|
|
|
Image(systemName: "square.and.arrow.up")
|
|
|
|
}()
|
|
|
|
|
2020-06-28 10:05:01 +02:00
|
|
|
static var smartFeedImage: RSImage = {
|
|
|
|
#if os(macOS)
|
|
|
|
return NSImage(systemSymbolName: "gear", accessibilityDescription: nil)!
|
|
|
|
#endif
|
|
|
|
#if os(iOS)
|
|
|
|
return UIImage(systemName: "gear")!
|
|
|
|
#endif
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var starredFeedImage: IconImage = {
|
|
|
|
#if os(macOS)
|
2020-07-04 02:19:40 +02:00
|
|
|
let image = NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)!
|
|
|
|
let coloredImage = image.tinted(with: NSColor(named: "StarColor")!)
|
|
|
|
return IconImage(coloredImage)
|
2020-06-28 10:05:01 +02:00
|
|
|
#endif
|
|
|
|
#if os(iOS)
|
2020-07-04 02:19:40 +02:00
|
|
|
let image = UIImage(systemName: "star.fill")!
|
|
|
|
let coloredImage = image.tinted(color: UIColor(named: "StarColor")!)!
|
|
|
|
return IconImage(coloredImage)
|
2020-06-28 10:05:01 +02:00
|
|
|
#endif
|
|
|
|
}()
|
|
|
|
|
2020-07-01 23:33:07 +02:00
|
|
|
static var timelineStarred: Image = {
|
2020-07-04 02:19:40 +02:00
|
|
|
#if os(macOS)
|
|
|
|
let image = NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)!
|
|
|
|
let coloredImage = image.tinted(with: NSColor(named: "StarColor")!)
|
|
|
|
return Image(nsImage: coloredImage)
|
|
|
|
#endif
|
|
|
|
#if os(iOS)
|
|
|
|
let image = UIImage(systemName: "star.fill")!
|
|
|
|
let coloredImage = image.tinted(color: UIColor(named: "StarColor")!)!
|
|
|
|
return Image(uiImage: coloredImage)
|
|
|
|
#endif
|
2020-07-01 23:33:07 +02:00
|
|
|
}()
|
|
|
|
|
2020-07-04 02:19:40 +02:00
|
|
|
static var timelineUnread: Image {
|
|
|
|
#if os(macOS)
|
|
|
|
let image = NSImage(systemSymbolName: "circle.fill", accessibilityDescription: nil)!
|
|
|
|
let coloredImage = image.tinted(with: NSColor(named: "AccentColor")!)
|
|
|
|
return Image(nsImage: coloredImage)
|
|
|
|
#endif
|
|
|
|
#if os(iOS)
|
|
|
|
let image = UIImage(systemName: "circle.fill")!
|
|
|
|
let coloredImage = image.tinted(color: UIColor(named: "AccentColor")!)!
|
|
|
|
return Image(uiImage: coloredImage)
|
|
|
|
#endif
|
|
|
|
}
|
2020-07-01 23:33:07 +02:00
|
|
|
|
2020-06-28 10:05:01 +02:00
|
|
|
static var todayFeedImage: IconImage = {
|
|
|
|
#if os(macOS)
|
2020-07-04 02:19:40 +02:00
|
|
|
let image = NSImage(systemSymbolName: "sun.max.fill", accessibilityDescription: nil)!
|
|
|
|
let coloredImage = image.tinted(with: .orange)
|
|
|
|
return IconImage(coloredImage)
|
2020-06-28 10:05:01 +02:00
|
|
|
#endif
|
|
|
|
#if os(iOS)
|
2020-07-04 02:19:40 +02:00
|
|
|
let image = UIImage(systemName: "sun.max.fill")!
|
|
|
|
let coloredImage = image.tinted(color: .orange)!
|
|
|
|
return IconImage(coloredImage)
|
2020-06-28 10:05:01 +02:00
|
|
|
#endif
|
|
|
|
}()
|
2020-07-04 02:19:40 +02:00
|
|
|
|
|
|
|
static var toggleStarred: Image = {
|
|
|
|
return Image(systemName: "star.fill")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var toggleRead: Image = {
|
|
|
|
return Image(systemName: "largecircle.fill.circle")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var unreadFeedImage: IconImage {
|
2020-06-28 10:05:01 +02:00
|
|
|
#if os(macOS)
|
2020-07-04 02:19:40 +02:00
|
|
|
let image = NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: nil)!
|
|
|
|
let coloredImage = image.tinted(with: NSColor(named: "AccentColor")!)
|
|
|
|
return IconImage(coloredImage)
|
2020-06-28 10:05:01 +02:00
|
|
|
#endif
|
|
|
|
#if os(iOS)
|
2020-07-04 02:19:40 +02:00
|
|
|
let image = UIImage(systemName: "largecircle.fill.circle")!
|
|
|
|
let coloredImage = image.tinted(color: UIColor(named: "AccentColor")!)!
|
|
|
|
return IconImage(coloredImage)
|
2020-06-28 10:05:01 +02:00
|
|
|
#endif
|
2020-07-04 02:19:40 +02:00
|
|
|
}
|
2020-06-28 10:05:01 +02:00
|
|
|
|
|
|
|
static func image(for accountType: AccountType) -> RSImage? {
|
|
|
|
switch accountType {
|
|
|
|
case .onMyMac:
|
|
|
|
#if os(macOS)
|
|
|
|
return AppAssets.accountLocalMacImage
|
|
|
|
#endif
|
|
|
|
#if os(iOS)
|
|
|
|
if UIDevice.current.userInterfaceIdiom == .pad {
|
|
|
|
return AppAssets.accountLocalPadImage
|
|
|
|
} else {
|
|
|
|
return AppAssets.accountLocalPhoneImage
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
case .cloudKit:
|
|
|
|
return AppAssets.accountCloudKitImage
|
|
|
|
case .feedbin:
|
|
|
|
return AppAssets.accountFeedbinImage
|
|
|
|
case .feedly:
|
|
|
|
return AppAssets.accountFeedlyImage
|
|
|
|
case .feedWrangler:
|
|
|
|
return AppAssets.accountFeedWranglerImage
|
|
|
|
case .freshRSS:
|
|
|
|
return AppAssets.accountFreshRSSImage
|
|
|
|
case .newsBlur:
|
|
|
|
return AppAssets.accountNewsBlurImage
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|