2018-02-18 03:19:25 +01:00
|
|
|
//
|
2019-05-21 12:42:40 +02:00
|
|
|
// AppAssets.swift
|
2018-08-29 07:18:24 +02:00
|
|
|
// NetNewsWire
|
2018-02-18 03:19:25 +01:00
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 2/17/18.
|
|
|
|
// Copyright © 2018 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import AppKit
|
2019-04-15 22:03:05 +02:00
|
|
|
import RSCore
|
2019-11-16 19:02:58 +01:00
|
|
|
import Account
|
2018-02-18 03:19:25 +01:00
|
|
|
|
2019-05-21 12:42:40 +02:00
|
|
|
struct AppAssets {
|
2018-02-18 03:19:25 +01:00
|
|
|
|
2020-10-24 21:18:01 +02:00
|
|
|
static var accountBazQux: RSImage! = {
|
|
|
|
return RSImage(named: "accountBazQux")
|
2020-03-18 21:48:44 +01:00
|
|
|
}()
|
|
|
|
|
2020-10-24 21:18:01 +02:00
|
|
|
static var accountCloudKit: RSImage! = {
|
|
|
|
return RSImage(named: "accountCloudKit")
|
2019-05-01 13:49:50 +02:00
|
|
|
}()
|
|
|
|
|
2019-05-01 17:28:13 +02:00
|
|
|
static var accountFeedbin: RSImage! = {
|
2019-05-01 19:37:13 +02:00
|
|
|
return RSImage(named: "accountFeedbin")
|
2019-05-01 17:28:13 +02:00
|
|
|
}()
|
|
|
|
|
2019-09-20 21:47:40 +02:00
|
|
|
static var accountFeedly: RSImage! = {
|
|
|
|
return RSImage(named: "accountFeedly")
|
|
|
|
}()
|
|
|
|
|
2019-09-28 06:44:58 +02:00
|
|
|
static var accountFeedWrangler: RSImage! = {
|
|
|
|
return RSImage(named: "accountFeedWrangler")
|
|
|
|
}()
|
|
|
|
|
2019-06-20 14:22:51 +02:00
|
|
|
static var accountFreshRSS: RSImage! = {
|
|
|
|
return RSImage(named: "accountFreshRSS")
|
2019-06-19 22:40:03 +02:00
|
|
|
}()
|
2020-03-23 00:52:48 +01:00
|
|
|
|
2020-10-24 21:18:01 +02:00
|
|
|
static var accountInoreader: RSImage! = {
|
|
|
|
return RSImage(named: "accountInoreader")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var accountLocal: RSImage! = {
|
|
|
|
return RSImage(named: "accountLocal")
|
|
|
|
}()
|
|
|
|
|
2020-03-23 00:52:48 +01:00
|
|
|
static var accountNewsBlur: RSImage! = {
|
|
|
|
return RSImage(named: "accountNewsBlur")
|
|
|
|
}()
|
2019-06-19 22:40:03 +02:00
|
|
|
|
2020-10-24 21:18:01 +02:00
|
|
|
static var accountTheOldReader: RSImage! = {
|
|
|
|
return RSImage(named: "accountTheOldReader")
|
|
|
|
}()
|
|
|
|
|
2020-08-10 18:43:18 +02:00
|
|
|
@available(macOS 11.0, *)
|
2020-08-09 18:46:53 +02:00
|
|
|
static var addNewSidebarItemImage: RSImage = {
|
|
|
|
return NSImage(systemSymbolName: "plus", accessibilityDescription: nil)!
|
|
|
|
}()
|
|
|
|
|
2020-08-11 00:34:12 +02:00
|
|
|
static var articleExtractorError: RSImage = {
|
|
|
|
return RSImage(named: "articleExtractorError")!
|
2019-09-19 22:44:31 +02:00
|
|
|
}()
|
2020-08-11 00:34:12 +02:00
|
|
|
|
|
|
|
static var articleExtractorOff: RSImage = {
|
|
|
|
return RSImage(named: "articleExtractorOff")!
|
2019-09-19 22:44:31 +02:00
|
|
|
}()
|
2020-08-11 00:34:12 +02:00
|
|
|
|
|
|
|
static var articleExtractorOn: RSImage = {
|
|
|
|
return RSImage(named: "articleExtractorOn")!
|
2019-09-19 22:44:31 +02:00
|
|
|
}()
|
2020-08-11 00:34:12 +02:00
|
|
|
|
2020-08-10 18:43:18 +02:00
|
|
|
@available(macOS 11.0, *)
|
2020-08-10 16:45:48 +02:00
|
|
|
static var cleanUpImage: RSImage = {
|
|
|
|
return NSImage(systemSymbolName: "wind", accessibilityDescription: nil)!
|
|
|
|
}()
|
|
|
|
|
2020-04-07 22:25:33 +02:00
|
|
|
static var extensionPointMarsEdit: RSImage = {
|
|
|
|
return RSImage(named: "extensionPointMarsEdit")!
|
2020-04-07 15:06:47 +02:00
|
|
|
}()
|
|
|
|
|
2020-04-07 22:25:33 +02:00
|
|
|
static var extensionPointMicroblog: RSImage = {
|
|
|
|
return RSImage(named: "extensionPointMicroblog")!
|
|
|
|
}()
|
|
|
|
|
2020-05-03 02:38:57 +02:00
|
|
|
static var extensionPointReddit: RSImage = {
|
|
|
|
return RSImage(named: "extensionPointReddit")!
|
|
|
|
}()
|
|
|
|
|
2020-04-07 22:25:33 +02:00
|
|
|
static var extensionPointTwitter: RSImage = {
|
|
|
|
return RSImage(named: "extensionPointTwitter")!
|
|
|
|
}()
|
|
|
|
|
2019-05-21 12:42:40 +02:00
|
|
|
static var faviconTemplateImage: RSImage = {
|
|
|
|
return RSImage(named: "faviconTemplateImage")!
|
|
|
|
}()
|
2019-06-14 22:33:13 +02:00
|
|
|
|
2020-03-22 21:39:37 +01:00
|
|
|
static var filterActive: RSImage = {
|
|
|
|
return RSImage(named: "filterActive")!
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var filterInactive: RSImage = {
|
|
|
|
return RSImage(named: "filterInactive")!
|
|
|
|
}()
|
|
|
|
|
2019-11-06 01:05:57 +01:00
|
|
|
static var iconLightBackgroundColor: NSColor = {
|
|
|
|
return NSColor(named: NSColor.Name("iconLightBackgroundColor"))!
|
2019-06-14 22:33:13 +02:00
|
|
|
}()
|
|
|
|
|
2019-11-06 01:05:57 +01:00
|
|
|
static var iconDarkBackgroundColor: NSColor = {
|
|
|
|
return NSColor(named: NSColor.Name("iconDarkBackgroundColor"))!
|
2019-06-14 22:33:13 +02:00
|
|
|
}()
|
2020-08-11 00:34:12 +02:00
|
|
|
|
|
|
|
static var legacyArticleExtractor: RSImage! = {
|
|
|
|
return RSImage(named: "legacyArticleExtractor")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var legacyArticleExtractorError: RSImage! = {
|
|
|
|
return RSImage(named: "legacyArticleExtractorError")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var legacyArticleExtractorInactiveDark: RSImage! = {
|
|
|
|
return RSImage(named: "legacyArticleExtractorInactiveDark")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var legacyArticleExtractorInactiveLight: RSImage! = {
|
|
|
|
return RSImage(named: "legacyArticleExtractorInactiveLight")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var legacyArticleExtractorProgress1: RSImage! = {
|
|
|
|
return RSImage(named: "legacyArticleExtractorProgress1")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var legacyArticleExtractorProgress2: RSImage! = {
|
|
|
|
return RSImage(named: "legacyArticleExtractorProgress2")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var legacyArticleExtractorProgress3: RSImage! = {
|
|
|
|
return RSImage(named: "legacyArticleExtractorProgress3")
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var legacyArticleExtractorProgress4: RSImage! = {
|
|
|
|
return RSImage(named: "legacyArticleExtractorProgress4")
|
|
|
|
}()
|
|
|
|
|
2020-08-10 20:53:21 +02:00
|
|
|
static var masterFolderImage: IconImage {
|
2020-08-10 18:43:18 +02:00
|
|
|
if #available(macOS 11.0, *) {
|
2020-08-09 01:15:45 +02:00
|
|
|
let image = NSImage(systemSymbolName: "folder", accessibilityDescription: nil)!
|
2020-08-10 20:53:21 +02:00
|
|
|
let preferredColor = NSColor(named: "AccentColor")!
|
|
|
|
let coloredImage = image.tinted(with: preferredColor)
|
|
|
|
return IconImage(coloredImage, isSymbol: true, preferredColor: preferredColor.cgColor)
|
2020-08-09 01:15:45 +02:00
|
|
|
} else {
|
|
|
|
return IconImage(RSImage(named: NSImage.folderName)!)
|
|
|
|
}
|
2020-08-10 20:53:21 +02:00
|
|
|
}
|
2019-09-18 03:26:49 +02:00
|
|
|
|
2020-08-10 16:28:45 +02:00
|
|
|
static var markAllAsReadImage: RSImage = {
|
|
|
|
return RSImage(named: "markAllAsRead")!
|
|
|
|
}()
|
|
|
|
|
2020-08-10 18:43:18 +02:00
|
|
|
@available(macOS 11.0, *)
|
2020-08-10 16:45:48 +02:00
|
|
|
static var nextUnreadImage: RSImage = {
|
|
|
|
return NSImage(systemSymbolName: "chevron.down.circle", accessibilityDescription: nil)!
|
|
|
|
}()
|
|
|
|
|
2020-08-10 18:43:18 +02:00
|
|
|
@available(macOS 11.0, *)
|
2020-08-10 16:45:48 +02:00
|
|
|
static var openInBrowserImage: RSImage = {
|
|
|
|
return NSImage(systemSymbolName: "safari", accessibilityDescription: nil)!
|
|
|
|
}()
|
|
|
|
|
2020-08-10 18:25:48 +02:00
|
|
|
static var preferencesToolbarAccountsImage: RSImage = {
|
2020-08-10 18:43:18 +02:00
|
|
|
if #available(macOS 11.0, *) {
|
2020-08-10 18:25:48 +02:00
|
|
|
return NSImage(systemSymbolName: "at", accessibilityDescription: nil)!
|
|
|
|
} else {
|
|
|
|
return NSImage(named: NSImage.userAccountsName)!
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var preferencesToolbarExtensionsImage: RSImage = {
|
2020-08-10 18:43:18 +02:00
|
|
|
if #available(macOS 11.0, *) {
|
2020-08-10 18:25:48 +02:00
|
|
|
return NSImage(named: "preferencesToolbarExtensions")!
|
|
|
|
} else {
|
|
|
|
return NSImage(contentsOfFile: "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/KEXT.icns")!
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var preferencesToolbarGeneralImage: RSImage = {
|
2020-08-10 18:43:18 +02:00
|
|
|
if #available(macOS 11.0, *) {
|
2020-08-10 18:25:48 +02:00
|
|
|
return NSImage(systemSymbolName: "gearshape", accessibilityDescription: nil)!
|
|
|
|
} else {
|
|
|
|
return NSImage(named: NSImage.preferencesGeneralName)!
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var preferencesToolbarAdvancedImage: RSImage = {
|
2020-08-10 18:43:18 +02:00
|
|
|
if #available(macOS 11.0, *) {
|
2020-08-10 18:25:48 +02:00
|
|
|
return NSImage(systemSymbolName: "gearshape.2", accessibilityDescription: nil)!
|
|
|
|
} else {
|
|
|
|
return NSImage(named: NSImage.advancedName)!
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
|
2020-08-10 18:43:18 +02:00
|
|
|
@available(macOS 11.0, *)
|
2020-08-09 13:02:48 +02:00
|
|
|
static var readClosedImage: RSImage = {
|
|
|
|
return NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: nil)!
|
|
|
|
}()
|
|
|
|
|
2020-08-10 18:43:18 +02:00
|
|
|
@available(macOS 11.0, *)
|
2020-08-09 13:02:48 +02:00
|
|
|
static var readOpenImage: RSImage = {
|
|
|
|
return NSImage(systemSymbolName: "circle", accessibilityDescription: nil)!
|
|
|
|
}()
|
|
|
|
|
2020-08-10 18:43:18 +02:00
|
|
|
@available(macOS 11.0, *)
|
2020-08-10 10:58:19 +02:00
|
|
|
static var refreshImage: RSImage = {
|
|
|
|
return NSImage(systemSymbolName: "arrow.clockwise", accessibilityDescription: nil)!
|
|
|
|
}()
|
|
|
|
|
2019-11-06 01:05:57 +01:00
|
|
|
static var searchFeedImage: IconImage = {
|
2020-08-09 00:27:32 +02:00
|
|
|
return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true)
|
2019-09-18 03:26:49 +02:00
|
|
|
}()
|
2020-08-10 16:45:48 +02:00
|
|
|
|
2020-08-10 18:43:18 +02:00
|
|
|
@available(macOS 11.0, *)
|
2020-08-10 16:45:48 +02:00
|
|
|
static var shareImage: RSImage = {
|
|
|
|
return NSImage(systemSymbolName: "square.and.arrow.up", accessibilityDescription: nil)!
|
|
|
|
}()
|
2019-09-18 03:26:49 +02:00
|
|
|
|
2020-08-12 04:03:19 +02:00
|
|
|
@available(macOS 11.0, *)
|
|
|
|
static var sidebarToggleImage: RSImage = {
|
|
|
|
return NSImage(systemSymbolName: "sidebar.left", accessibilityDescription: nil)!
|
|
|
|
}()
|
|
|
|
|
2020-08-10 18:43:18 +02:00
|
|
|
@available(macOS 11.0, *)
|
2020-08-09 13:02:48 +02:00
|
|
|
static var starClosedImage: RSImage = {
|
|
|
|
return NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)!
|
|
|
|
}()
|
|
|
|
|
2020-08-10 18:43:18 +02:00
|
|
|
@available(macOS 11.0, *)
|
2020-08-09 13:02:48 +02:00
|
|
|
static var starOpenImage: RSImage = {
|
|
|
|
return NSImage(systemSymbolName: "star", accessibilityDescription: nil)!
|
|
|
|
}()
|
|
|
|
|
2019-11-06 01:05:57 +01:00
|
|
|
static var starredFeedImage: IconImage = {
|
2020-08-10 18:43:18 +02:00
|
|
|
if #available(macOS 11.0, *) {
|
2020-08-09 01:15:45 +02:00
|
|
|
let image = NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)!
|
2020-08-10 20:53:21 +02:00
|
|
|
let preferredColor = NSColor(named: "StarColor")!
|
|
|
|
let coloredImage = image.tinted(with: preferredColor)
|
|
|
|
return IconImage(coloredImage, isSymbol: true, preferredColor: preferredColor.cgColor)
|
2020-08-09 01:15:45 +02:00
|
|
|
} else {
|
|
|
|
return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true)
|
|
|
|
}
|
2019-09-18 03:26:49 +02:00
|
|
|
}()
|
|
|
|
|
2020-08-20 03:00:34 +02:00
|
|
|
static var timelineStarSelected: RSImage! = {
|
|
|
|
return RSImage(named: "timelineStar")?.tinted(with: .white)
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var timelineStarUnselected: RSImage! = {
|
|
|
|
return RSImage(named: "timelineStar")?.tinted(with: starColor)
|
2020-03-22 21:39:37 +01:00
|
|
|
}()
|
|
|
|
|
2019-11-06 01:05:57 +01:00
|
|
|
static var todayFeedImage: IconImage = {
|
2020-08-10 18:43:18 +02:00
|
|
|
if #available(macOS 11.0, *) {
|
2020-08-09 01:15:45 +02:00
|
|
|
let image = NSImage(systemSymbolName: "sun.max.fill", accessibilityDescription: nil)!
|
2020-08-10 20:53:21 +02:00
|
|
|
let preferredColor = NSColor.orange
|
|
|
|
let coloredImage = image.tinted(with: preferredColor)
|
|
|
|
return IconImage(coloredImage, isSymbol: true, preferredColor: preferredColor.cgColor)
|
2020-08-09 01:15:45 +02:00
|
|
|
} else {
|
|
|
|
return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true)
|
|
|
|
}
|
2019-09-18 03:26:49 +02:00
|
|
|
}()
|
|
|
|
|
2019-11-06 01:05:57 +01:00
|
|
|
static var unreadFeedImage: IconImage = {
|
2020-08-10 18:43:18 +02:00
|
|
|
if #available(macOS 11.0, *) {
|
2020-08-09 01:15:45 +02:00
|
|
|
let image = NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: nil)!
|
2020-08-10 20:53:21 +02:00
|
|
|
let preferredColor = NSColor(named: "AccentColor")!
|
|
|
|
let coloredImage = image.tinted(with: preferredColor)
|
|
|
|
return IconImage(coloredImage, isSymbol: true, preferredColor: preferredColor.cgColor)
|
2020-08-09 01:15:45 +02:00
|
|
|
} else {
|
|
|
|
return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true)
|
|
|
|
}
|
2019-09-18 03:26:49 +02:00
|
|
|
}()
|
|
|
|
|
2019-10-22 20:39:15 +02:00
|
|
|
static var swipeMarkReadImage: RSImage = {
|
|
|
|
return RSImage(named: "swipeMarkRead")!
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var swipeMarkUnreadImage: RSImage = {
|
|
|
|
return RSImage(named: "swipeMarkUnread")!
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var swipeMarkStarredImage: RSImage = {
|
|
|
|
return RSImage(named: "swipeMarkStarred")!
|
|
|
|
}()
|
|
|
|
|
|
|
|
static var swipeMarkUnstarredImage: RSImage = {
|
|
|
|
return RSImage(named: "swipeMarkUnstarred")!
|
|
|
|
}()
|
|
|
|
|
2020-08-20 03:00:34 +02:00
|
|
|
static var starColor: NSColor = {
|
2020-08-20 04:03:55 +02:00
|
|
|
return NSColor(named: NSColor.Name("StarColor"))!
|
2020-02-28 01:27:12 +01:00
|
|
|
}()
|
|
|
|
|
2019-11-16 19:02:58 +01:00
|
|
|
static func image(for accountType: AccountType) -> NSImage? {
|
|
|
|
switch accountType {
|
|
|
|
case .onMyMac:
|
|
|
|
return AppAssets.accountLocal
|
2020-03-18 21:48:44 +01:00
|
|
|
case .cloudKit:
|
|
|
|
return AppAssets.accountCloudKit
|
2020-10-24 21:18:01 +02:00
|
|
|
case .bazQux:
|
|
|
|
return AppAssets.accountBazQux
|
2019-11-16 19:02:58 +01:00
|
|
|
case .feedbin:
|
|
|
|
return AppAssets.accountFeedbin
|
|
|
|
case .feedly:
|
|
|
|
return AppAssets.accountFeedly
|
2019-11-21 18:28:08 +01:00
|
|
|
case .feedWrangler:
|
|
|
|
return AppAssets.accountFeedWrangler
|
2019-11-16 19:02:58 +01:00
|
|
|
case .freshRSS:
|
|
|
|
return AppAssets.accountFreshRSS
|
2020-10-24 21:18:01 +02:00
|
|
|
case .inoreader:
|
|
|
|
return AppAssets.accountInoreader
|
2020-03-23 00:52:48 +01:00
|
|
|
case .newsBlur:
|
|
|
|
return AppAssets.accountNewsBlur
|
2020-10-24 21:18:01 +02:00
|
|
|
case .theOldReader:
|
|
|
|
return AppAssets.accountTheOldReader
|
2019-11-16 19:02:58 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-18 03:19:25 +01:00
|
|
|
}
|