diff --git a/Mac/AppAssets.swift b/Mac/AppAssets.swift deleted file mode 100644 index 78d4d59d4..000000000 --- a/Mac/AppAssets.swift +++ /dev/null @@ -1,285 +0,0 @@ -// -// AppAssets.swift -// NetNewsWire -// -// Created by Brent Simmons on 2/17/18. -// Copyright © 2018 Ranchero Software. All rights reserved. -// - -import AppKit -import RSCore -import Account - -struct AppAssets { - -// static var accountBazQux: RSImage! = { -// return RSImage(named: "accountBazQux") -// }() - -// static var accountCloudKit: RSImage! = { -// return RSImage(named: "accountCloudKit") -// }() -// -// static var accountFeedbin: RSImage! = { -// return RSImage(named: "accountFeedbin") -// }() -// -// static var accountFeedly: RSImage! = { -// return RSImage(named: "accountFeedly") -// }() -// -// static var accountFreshRSS: RSImage! = { -// return RSImage(named: "accountFreshRSS") -// }() -// -// static var accountInoreader: RSImage! = { -// return RSImage(named: "accountInoreader") -// }() -// -// static var accountLocal: RSImage! = { -// return RSImage(named: "accountLocal") -// }() -// -// static var accountNewsBlur: RSImage! = { -// return RSImage(named: "accountNewsBlur") -// }() -// -// static var accountTheOldReader: RSImage! = { -// return RSImage(named: "accountTheOldReader") -// }() - -// static let nnwFeedIcon = RSImage(named: "nnwFeedIcon")! - - @available(macOS 11.0, *) - static var addNewSidebarItemImage: RSImage = { - return NSImage(systemSymbolName: "plus", accessibilityDescription: nil)! - }() - -// static var articleExtractorError: RSImage = { -// return RSImage(named: "articleExtractorError")! -// }() -// -// static var articleExtractorOff: RSImage = { -// return RSImage(named: "articleExtractorOff")! -// }() -// -// static var articleExtractorOn: RSImage = { -// return RSImage(named: "articleExtractorOn")! -// }() - -// static var articleTheme: RSImage = { -// return NSImage(systemSymbolName: "doc.richtext", accessibilityDescription: nil)! -// }() - -// static var cleanUpImage: RSImage = { -// return NSImage(systemSymbolName: "wind", accessibilityDescription: nil)! -// }() - -// static var marsEditIcon: RSImage = { -// return RSImage(named: "MarsEditIcon")! -// }() -// -// static var microblogIcon: RSImage = { -// return RSImage(named: "MicroblogIcon")! -// }() - -// static var faviconTemplateImage: RSImage = { -// return RSImage(named: "faviconTemplateImage")! -// }() - - static var filterActive: RSImage = { - return NSImage(systemSymbolName: "line.horizontal.3.decrease.circle.fill", accessibilityDescription: nil)! - }() - - static var filterInactive: RSImage = { - return NSImage(systemSymbolName: "line.horizontal.3.decrease.circle", accessibilityDescription: nil)! - }() - -// static var iconLightBackgroundColor: NSColor = { -// return NSColor(named: NSColor.Name("iconLightBackgroundColor"))! -// }() - -// static var iconDarkBackgroundColor: NSColor = { -// return NSColor(named: NSColor.Name("iconDarkBackgroundColor"))! -// }() - -// 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") -// }() - - static var folderImage: IconImage { - let image = NSImage(systemSymbolName: "folder", accessibilityDescription: nil)! - let preferredColor = NSColor(named: "AccentColor")! - let coloredImage = image.tinted(with: preferredColor) - return IconImage(coloredImage, isSymbol: true, isBackgroundSuppressed: true, preferredColor: preferredColor.cgColor) - } - -// static var markAllAsReadImage: RSImage = { -// return RSImage(named: "markAllAsRead")! -// }() - - static var nextUnreadImage: RSImage = { - return NSImage(systemSymbolName: "chevron.down.circle", accessibilityDescription: nil)! - }() - - static var openInBrowserImage: RSImage = { - return NSImage(systemSymbolName: "safari", accessibilityDescription: nil)! - }() - - static var preferencesToolbarAccountsImage: RSImage = { - return NSImage(systemSymbolName: "at", accessibilityDescription: nil)! - }() - - static var preferencesToolbarExtensionsImage: RSImage = { - return RSImage(named: "preferencesToolbarExtensions")! - }() - - static var preferencesToolbarGeneralImage: RSImage = { - return NSImage(systemSymbolName: "gearshape", accessibilityDescription: nil)! - }() - - static var preferencesToolbarAdvancedImage: RSImage = { - return NSImage(systemSymbolName: "gearshape.2", accessibilityDescription: nil)! - }() - - static var readClosedImage: RSImage = { - return NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: nil)! - }() - - static var readOpenImage: RSImage = { - return NSImage(systemSymbolName: "circle", accessibilityDescription: nil)! - }() - - static var refreshImage: RSImage = { - return NSImage(systemSymbolName: "arrow.clockwise", accessibilityDescription: nil)! - }() - - static var searchFeedImage: IconImage = { - return IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true, isBackgroundSuppressed: true) - }() - -// static var shareImage: RSImage = { -// return NSImage(systemSymbolName: "square.and.arrow.up", accessibilityDescription: nil)! -// }() - -// static var sidebarToggleImage: RSImage = { -// return NSImage(systemSymbolName: "sidebar.left", accessibilityDescription: nil)! -// }() - - static var starClosedImage: RSImage = { - return NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)! - }() - - static var starOpenImage: RSImage = { - return NSImage(systemSymbolName: "star", accessibilityDescription: nil)! - }() - - static var starredFeedImage: IconImage = { - let image = NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)! - let preferredColor = NSColor(named: "StarColor")! - let coloredImage = image.tinted(with: preferredColor) - return IconImage(coloredImage, isSymbol: true, isBackgroundSuppressed: true, preferredColor: preferredColor.cgColor) - }() - -// static var timelineSeparatorColor: NSColor = { -// return NSColor(named: "timelineSeparatorColor")! -// }() -// - static var timelineStarSelected: RSImage! = { - return RSImage(named: "timelineStar")?.tinted(with: .white) - }() - - static var timelineStarUnselected: RSImage! = { - return RSImage(named: "timelineStar")?.tinted(with: starColor) - }() - - static var todayFeedImage: IconImage = { - let image = NSImage(systemSymbolName: "sun.max.fill", accessibilityDescription: nil)! - let preferredColor = NSColor.orange - let coloredImage = image.tinted(with: preferredColor) - return IconImage(coloredImage, isSymbol: true, isBackgroundSuppressed: true, preferredColor: preferredColor.cgColor) - }() - - static var unreadFeedImage: IconImage = { - let image = NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: nil)! - let preferredColor = NSColor(named: "AccentColor")! - let coloredImage = image.tinted(with: preferredColor) - return IconImage(coloredImage, isSymbol: true, isBackgroundSuppressed: true, preferredColor: preferredColor.cgColor) - }() - - static var swipeMarkReadImage: RSImage = { - return RSImage(systemSymbolName: "circle", accessibilityDescription: "Mark Read")! - .withSymbolConfiguration(.init(scale: .large))! - }() - - static var swipeMarkUnreadImage: RSImage = { - return RSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: "Mark Unread")! - .withSymbolConfiguration(.init(scale: .large))! - }() - - static var swipeMarkStarredImage: RSImage = { - return RSImage(systemSymbolName: "star.fill", accessibilityDescription: "Star")! - .withSymbolConfiguration(.init(scale: .large))! - }() - - static var swipeMarkUnstarredImage: RSImage = { - return RSImage(systemSymbolName: "star", accessibilityDescription: "Unstar")! - .withSymbolConfiguration(.init(scale: .large))! - }() - - static var starColor: NSColor = { - return NSColor(named: NSColor.Name("StarColor"))! - }() - -// static func image(for accountType: AccountType) -> NSImage? { -// switch accountType { -// case .onMyMac: -// return AppAssets.accountLocal -// case .cloudKit: -// return AppAssets.accountCloudKit -// case .bazQux: -// return AppAsset.accountBazQuxImage -// case .feedbin: -// return AppAssets.accountFeedbin -// case .feedly: -// return AppAssets.accountFeedly -// case .freshRSS: -// return AppAssets.accountFreshRSS -// case .inoreader: -// return AppAssets.accountInoreader -// case .newsBlur: -// return AppAssets.accountNewsBlur -// case .theOldReader: -// return AppAssets.accountTheOldReader -// } -// } - -} diff --git a/Mac/MainWindow/MainWindowController.swift b/Mac/MainWindow/MainWindowController.swift index f147851f2..29e18b781 100644 --- a/Mac/MainWindow/MainWindowController.swift +++ b/Mac/MainWindow/MainWindowController.swift @@ -753,11 +753,11 @@ extension MainWindowController: NSToolbarDelegate { case .refresh: let title = NSLocalizedString("Refresh", comment: "Refresh") - return buildToolbarButton(.refresh, title, AppAssets.refreshImage, "refreshAll:") + return buildToolbarButton(.refresh, title, AppImage.refresh, "refreshAll:") case .newSidebarItemMenu: let toolbarItem = NSMenuToolbarItem(itemIdentifier: .newSidebarItemMenu) - toolbarItem.image = AppAssets.addNewSidebarItemImage + toolbarItem.image = AppImage.addNewSidebarItem let description = NSLocalizedString("Add Item", comment: "Add Item") toolbarItem.toolTip = description toolbarItem.label = description @@ -770,22 +770,22 @@ extension MainWindowController: NSToolbarDelegate { case .toggleReadArticlesFilter: let title = NSLocalizedString("Read Articles Filter", comment: "Read Articles Filter") - return buildToolbarButton(.toggleReadArticlesFilter, title, AppAssets.filterInactive, "toggleReadArticlesFilter:") + return buildToolbarButton(.toggleReadArticlesFilter, title, AppImage.filterInactive, "toggleReadArticlesFilter:") case .timelineTrackingSeparator: return NSTrackingSeparatorToolbarItem(identifier: .timelineTrackingSeparator, splitView: splitViewController!.splitView, dividerIndex: 1) case .markRead: let title = NSLocalizedString("Mark Read", comment: "Mark Read") - return buildToolbarButton(.markRead, title, AppAssets.readClosedImage, "toggleRead:") + return buildToolbarButton(.markRead, title, AppImage.readClosed, "toggleRead:") case .markStar: let title = NSLocalizedString("Star", comment: "Star") - return buildToolbarButton(.markStar, title, AppAssets.starOpenImage, "toggleStarred:") + return buildToolbarButton(.markStar, title, AppImage.starOpen, "toggleStarred:") case .nextUnread: let title = NSLocalizedString("Next Unread", comment: "Next Unread") - return buildToolbarButton(.nextUnread, title, AppAssets.nextUnreadImage, "nextUnread:") + return buildToolbarButton(.nextUnread, title, AppImage.nextUnread, "nextUnread:") case .readerView: let toolbarItem = RSToolbarItem(itemIdentifier: .readerView) @@ -804,7 +804,7 @@ extension MainWindowController: NSToolbarDelegate { case .openInBrowser: let title = NSLocalizedString("Open in Browser", comment: "Open in Browser") - return buildToolbarButton(.openInBrowser, title, AppAssets.openInBrowserImage, "openArticleInBrowser:") + return buildToolbarButton(.openInBrowser, title, AppImage.openInBrowser, "openArticleInBrowser:") case .articleThemeMenu: articleThemeMenuToolbarItem.image = AppImage.articleTheme @@ -1033,7 +1033,7 @@ private extension MainWindowController { } if let toolbarItem = item as? NSToolbarItem, let button = toolbarItem.view as? NSButton { - button.image = markingRead ? AppAssets.readClosedImage : AppAssets.readOpenImage + button.image = markingRead ? AppImage.readClosed : AppImage.readOpen } return result @@ -1117,7 +1117,7 @@ private extension MainWindowController { } if let toolbarItem = item as? NSToolbarItem, let button = toolbarItem.view as? NSButton { - button.image = starring ? AppAssets.starOpenImage : AppAssets.starClosedImage + button.image = starring ? AppImage.starOpen : AppImage.starClosed } return result @@ -1144,7 +1144,7 @@ private extension MainWindowController { (item as? NSMenuItem)?.title = hideCommand if let toolbarItem = item as? NSToolbarItem, let button = toolbarItem.view as? NSButton { toolbarItem.toolTip = hideCommand - button.image = AppAssets.filterInactive + button.image = AppImage.filterInactive } return false } @@ -1153,13 +1153,13 @@ private extension MainWindowController { (item as? NSMenuItem)?.title = showCommand if let toolbarItem = item as? NSToolbarItem, let button = toolbarItem.view as? NSButton { toolbarItem.toolTip = showCommand - button.image = AppAssets.filterActive + button.image = AppImage.filterActive } } else { (item as? NSMenuItem)?.title = hideCommand if let toolbarItem = item as? NSToolbarItem, let button = toolbarItem.view as? NSButton { toolbarItem.toolTip = hideCommand - button.image = AppAssets.filterInactive + button.image = AppImage.filterInactive } } diff --git a/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift b/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift index b7ef6de19..14ddcf674 100644 --- a/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift +++ b/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift @@ -20,7 +20,7 @@ final class TimelineTableCellView: NSTableCellView { private lazy var iconView = IconView() - private var starView = TimelineTableCellView.imageView(with: AppAssets.timelineStarUnselected, scaling: .scaleNone) + private var starView = TimelineTableCellView.imageView(with: AppImage.timelineStarUnselected, scaling: .scaleNone) private lazy var textFields = { return [self.dateView, self.feedNameView, self.titleView, self.summaryView, self.textView] @@ -258,9 +258,9 @@ private extension TimelineTableCellView { func updateStarView() { if isSelected && isEmphasized { - starView.image = AppAssets.timelineStarSelected + starView.image = AppImage.timelineStarSelected } else { - starView.image = AppAssets.timelineStarUnselected + starView.image = AppImage.timelineStarUnselected } showOrHideView(starView, !cellData.starred) } diff --git a/Mac/MainWindow/Timeline/TimelineContainerViewController.swift b/Mac/MainWindow/Timeline/TimelineContainerViewController.swift index f8eef0235..b4920cf68 100644 --- a/Mac/MainWindow/Timeline/TimelineContainerViewController.swift +++ b/Mac/MainWindow/Timeline/TimelineContainerViewController.swift @@ -209,9 +209,9 @@ private extension TimelineContainerViewController { readFilteredButton.isHidden = false if isReadFiltered { - readFilteredButton.image = AppAssets.filterActive + readFilteredButton.image = AppImage.filterActive } else { - readFilteredButton.image = AppAssets.filterInactive + readFilteredButton.image = AppImage.filterInactive } } diff --git a/Mac/MainWindow/Timeline/TimelineViewController.swift b/Mac/MainWindow/Timeline/TimelineViewController.swift index ddb75cd55..41a672571 100644 --- a/Mac/MainWindow/Timeline/TimelineViewController.swift +++ b/Mac/MainWindow/Timeline/TimelineViewController.swift @@ -915,7 +915,7 @@ extension TimelineViewController: NSTableViewDelegate { self.toggleArticleRead(article) tableView.rowActionsVisible = false } - action.image = article.status.read ? AppAssets.swipeMarkUnreadImage : AppAssets.swipeMarkReadImage + action.image = article.status.read ? AppImage.swipeMarkUnread : AppImage.swipeMarkRead return [action] case .trailing: @@ -923,8 +923,8 @@ extension TimelineViewController: NSTableViewDelegate { self.toggleArticleStarred(article) tableView.rowActionsVisible = false } - action.backgroundColor = AppAssets.starColor - action.image = article.status.starred ? AppAssets.swipeMarkUnstarredImage : AppAssets.swipeMarkStarredImage + action.backgroundColor = AppColor.star + action.image = article.status.starred ? AppImage.swipeMarkUnstarred: AppImage.swipeMarkStarred return [action] @unknown default: diff --git a/Mac/Preferences/PreferencesWindowController.swift b/Mac/Preferences/PreferencesWindowController.swift index 13ab9b068..99ac42831 100644 --- a/Mac/Preferences/PreferencesWindowController.swift +++ b/Mac/Preferences/PreferencesWindowController.swift @@ -35,13 +35,13 @@ final class PreferencesWindowController: NSWindowController, NSToolbarDelegate { var specs = [PreferencesToolbarItemSpec]() specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.General, name: NSLocalizedString("General", comment: "Preferences"), - image: AppAssets.preferencesToolbarGeneralImage)] + image: AppImage.preferencesToolbarGeneral)] specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Accounts, name: NSLocalizedString("Accounts", comment: "Preferences"), - image: AppAssets.preferencesToolbarAccountsImage)] + image: AppImage.preferencesToolbarAccounts)] specs += [PreferencesToolbarItemSpec(identifierRawValue: ToolbarItemIdentifier.Advanced, name: NSLocalizedString("Advanced", comment: "Preferences"), - image: AppAssets.preferencesToolbarAdvancedImage)] + image: AppImage.preferencesToolbarAdvanced)] return specs }() diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index e1e092c08..2644df027 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -308,7 +308,6 @@ isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = ( /Localized/ShareExtension/MainInterface.storyboard, - AppAssets.swift, Resources/Assets.xcassets, ShareExtension/ShareFolderPickerAccountCell.xib, ShareExtension/ShareFolderPickerCell.swift, @@ -421,6 +420,7 @@ 84C1ECED2CDFE49100C7456A /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = ( + AppColor.swift, AppImage.swift, Defaults/AppDefaults.swift, Defaults/ArticleTextSize.swift, diff --git a/Shared/AppColor.swift b/Shared/AppColor.swift index 2b7e95657..8c903bff3 100644 --- a/Shared/AppColor.swift +++ b/Shared/AppColor.swift @@ -15,6 +15,8 @@ import UIKit struct AppColor { + static var accent = color(isMac ? "AccentColor" : "primaryAccentColor") + static var star = color(isMac ? "StarColor" : "starColor") } // MARK: - Mac @@ -33,7 +35,13 @@ extension AppColor { extension AppColor { #if os(iOS) + static var controlBackground = color("controlBackgroundColor") + static var fullScreenBackground = color("fullScreenBackgroundColor") + static var iconBackground = color("iconBackgroundColor") + static var secondaryAccent = color("secondaryAccentColor") + static var sectionHeader = color("sectionHeaderColor") static var tickMark = color("tickMarkColor") + static var vibrantText = color("vibrantTextColor") #endif } @@ -41,6 +49,14 @@ extension AppColor { private extension AppColor { +#if os(macOS) + static var isMac = true + static var isiOS = false +#elseif os(iOS) + static var isMac = false + static var isiOS = true +#endif + #if os(macOS) static func color(_ name: String) -> NSColor { NSColor(named: name)! diff --git a/Shared/AppImage.swift b/Shared/AppImage.swift index c2733be9c..9565be923 100644 --- a/Shared/AppImage.swift +++ b/Shared/AppImage.swift @@ -45,9 +45,13 @@ struct AppImage { static var articleExtractorOff = appImage("articleExtractorOff") static var articleExtractorOn = appImage("articleExtractorOn") static var faviconTemplate = appImage("faviconTemplateImage") + static var filterActive = systemImage("line.horizontal.3.decrease.circle.fill") + static var filterInactive = systemImage("line.horizontal.3.decrease.circle") static var markAllAsRead = appImage("markAllAsRead") static let nnwFeedIcon = RSImage(named: "nnwFeedIcon")! static var share = systemImage("square.and.arrow.up") + static var starClosed = systemImage("star.fill") + static var starOpen = systemImage("star") } // MARK: - Mac @@ -55,10 +59,75 @@ struct AppImage { extension AppImage { #if os(macOS) + static var addNewSidebarItem = systemImage("plus") static var articleTheme = systemImage("doc.richtext") static var cleanUp = systemImage("wind") static var marsEditIcon = appImage("MarsEditIcon") static var microblogIcon = appImage("MicroblogIcon") + static var nextUnread = systemImage("chevron.down.circle") + static var openInBrowser = systemImage("safari") + static var preferencesToolbarAccounts = systemImage("at") + static var preferencesToolbarAdvanced = systemImage("gearshape.2") + static var preferencesToolbarGeneral = systemImage("gearshape") + static var readClosed = systemImage("largecircle.fill.circle") + static var readOpen = systemImage("circle") + static var refresh = systemImage("arrow.clockwise") + static var timelineStarSelected = appImage("timelineStar").tinted(with: .white) + static var timelineStarUnselected = appImage("timelineStar").tinted(with: AppColor.star) + + static var swipeMarkRead: RSImage = { + RSImage(systemSymbolName: "circle", accessibilityDescription: "Mark Read")! + .withSymbolConfiguration(.init(scale: .large))! + }() + + static var swipeMarkUnread: RSImage = { + RSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: "Mark Unread")! + .withSymbolConfiguration(.init(scale: .large))! + }() + + static var swipeMarkStarred: RSImage = { + RSImage(systemSymbolName: "star.fill", accessibilityDescription: "Star")! + .withSymbolConfiguration(.init(scale: .large))! + }() + + static var swipeMarkUnstarred: RSImage = { + RSImage(systemSymbolName: "star", accessibilityDescription: "Unstar")! + .withSymbolConfiguration(.init(scale: .large))! + }() + + // IconImages + + static var searchFeed = IconImage(RSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true, isBackgroundSuppressed: true) + + // TODO: handle color palette change + + static var starredFeed: IconImage = { + let image = systemImage("star.fill") + let preferredColor = AppColor.star + let coloredImage = image.tinted(with: preferredColor) + return IconImage(coloredImage, isSymbol: true, isBackgroundSuppressed: true, preferredColor: preferredColor.cgColor) + }() + + static var todayFeed: IconImage = { + let image = systemImage("sun.max.fill") + let preferredColor = NSColor.orange + let coloredImage = image.tinted(with: preferredColor) + return IconImage(coloredImage, isSymbol: true, isBackgroundSuppressed: true, preferredColor: preferredColor.cgColor) + }() + + static var unreadFeed: IconImage = { + let image = systemImage("largecircle.fill.circle") + let preferredColor = AppColor.accent + let coloredImage = image.tinted(with: preferredColor) + return IconImage(coloredImage, isSymbol: true, isBackgroundSuppressed: true, preferredColor: preferredColor.cgColor) + }() + + static var folder: IconImage = { + let image = systemImage("folder") + let preferredColor = AppColor.accent + let coloredImage = image.tinted(with: preferredColor) + return IconImage(coloredImage, isSymbol: true, isBackgroundSuppressed: true, preferredColor: preferredColor.cgColor) + }() #endif } @@ -69,16 +138,14 @@ extension AppImage { #if os(iOS) static var articleExtractorOffSF = systemImage("doc.plaintext") static var articleExtractorOnSF = appImage("articleExtractorOnSF") - static var articleExtractorOffTinted = articleExtractorOff.tinted(color: AppAssets.primaryAccentColor)! - static var articleExtractorOnTinted = articleExtractorOn.tinted(color: AppAssets.primaryAccentColor)! + static var articleExtractorOffTinted = articleExtractorOff.tinted(color: AppColor.accent)! + static var articleExtractorOnTinted = articleExtractorOn.tinted(color: AppColor.accent)! static var circleClosed = systemImage("largecircle.fill.circle") static var circleOpen = systemImage("circle") static var copy = systemImage("doc.on.doc") static var deactivate = systemImage("minus.circle") static var disclosure = appImage("disclosure") static var edit = systemImage("square.and.pencil") - static var filterActive = systemImage("line.horizontal.3.decrease.circle.fill") - static var filterInactive = systemImage("line.horizontal.3.decrease.circle") static var folderOutlinePlus = systemImage("folder.badge.plus") static var info = systemImage("info.circle") static var markBelowAsRead = systemImage("arrowtriangle.down.circle") @@ -90,9 +157,34 @@ extension AppImage { static var plus = systemImage("plus") static var previousArticle = systemImage("chevron.up") static var safari = systemImage("safari") - static var timelineStar = systemImage("star.fill").withTintColor(AppAssets.starColor, renderingMode: .alwaysOriginal) + static var timelineStar = systemImage("star.fill").withTintColor(AppColor.star, renderingMode: .alwaysOriginal) static var trash = systemImage("trash") + // IconImages + + static var searchFeed = IconImage(systemImage("magnifyingglass"), isSymbol: true) + + // TODO: handle color palette change + + static var starredFeed: IconImage = { + let image = systemImage("star.fill") + return IconImage(image, isSymbol: true, isBackgroundSuppressed: true, preferredColor: AppColor.star.cgColor) + }() + + static var todayFeed: IconImage = { + let image = systemImage("sun.max.fill") + return IconImage(image, isSymbol: true, isBackgroundSuppressed: true, preferredColor: UIColor.systemOrange.cgColor) + }() + + static var unreadFeed: IconImage = { + let image = systemImage("largecircle.fill.circle") + return IconImage(image, isSymbol: true, isBackgroundSuppressed: true, preferredColor: AppColor.secondaryAccent.cgColor) + }() + + static var folder: IconImage = { + let image = systemImage("folder.fill") + return IconImage(image, isSymbol: true, isBackgroundSuppressed: true, preferredColor: AppColor.secondaryAccent.cgColor) + }() #endif } diff --git a/Shared/Extensions/SmallIconProvider.swift b/Shared/Extensions/SmallIconProvider.swift index c0c7dc7e9..7dd606bdd 100644 --- a/Shared/Extensions/SmallIconProvider.swift +++ b/Shared/Extensions/SmallIconProvider.swift @@ -37,6 +37,6 @@ extension Feed: SmallIconProvider { extension Folder: SmallIconProvider { var smallIcon: IconImage? { - AppAssets.folderImage + AppImage.folder } } diff --git a/Shared/SmartFeeds/SearchFeedDelegate.swift b/Shared/SmartFeeds/SearchFeedDelegate.swift index a42843161..82a0ddd28 100644 --- a/Shared/SmartFeeds/SearchFeedDelegate.swift +++ b/Shared/SmartFeeds/SearchFeedDelegate.swift @@ -25,7 +25,7 @@ struct SearchFeedDelegate: SmartFeedDelegate { let nameForDisplayPrefix = NSLocalizedString("Search: ", comment: "Search smart feed title prefix") let searchString: String let fetchType: FetchType - var smallIcon: IconImage? = AppAssets.searchFeedImage + var smallIcon: IconImage? = AppImage.searchFeed init(searchString: String) { self.searchString = searchString diff --git a/Shared/SmartFeeds/SearchTimelineFeedDelegate.swift b/Shared/SmartFeeds/SearchTimelineFeedDelegate.swift index 53acc7a50..1f3188422 100644 --- a/Shared/SmartFeeds/SearchTimelineFeedDelegate.swift +++ b/Shared/SmartFeeds/SearchTimelineFeedDelegate.swift @@ -25,7 +25,7 @@ struct SearchTimelineFeedDelegate: SmartFeedDelegate { let nameForDisplayPrefix = NSLocalizedString("Search: ", comment: "Search smart feed title prefix") let searchString: String let fetchType: FetchType - var smallIcon: IconImage? = AppAssets.searchFeedImage + var smallIcon: IconImage? = AppImage.searchFeed init(searchString: String, articleIDs: Set) { self.searchString = searchString diff --git a/Shared/SmartFeeds/StarredFeedDelegate.swift b/Shared/SmartFeeds/StarredFeedDelegate.swift index 1eae46c08..64727ba15 100644 --- a/Shared/SmartFeeds/StarredFeedDelegate.swift +++ b/Shared/SmartFeeds/StarredFeedDelegate.swift @@ -23,7 +23,7 @@ struct StarredFeedDelegate: SmartFeedDelegate { let nameForDisplay = NSLocalizedString("Starred", comment: "Starred pseudo-feed title") let fetchType: FetchType = .starred(nil) var smallIcon: IconImage? { - return AppAssets.starredFeedImage + return AppImage.starredFeed } func fetchUnreadCount(for account: Account, completion: @escaping SingleUnreadCountCompletionBlock) { diff --git a/Shared/SmartFeeds/TodayFeedDelegate.swift b/Shared/SmartFeeds/TodayFeedDelegate.swift index 0f4c18b18..8ea824421 100644 --- a/Shared/SmartFeeds/TodayFeedDelegate.swift +++ b/Shared/SmartFeeds/TodayFeedDelegate.swift @@ -21,7 +21,7 @@ struct TodayFeedDelegate: SmartFeedDelegate { let nameForDisplay = NSLocalizedString("Today", comment: "Today pseudo-feed title") let fetchType = FetchType.today(nil) var smallIcon: IconImage? { - return AppAssets.todayFeedImage + return AppImage.todayFeed } func fetchUnreadCount(for account: Account, completion: @escaping SingleUnreadCountCompletionBlock) { diff --git a/Shared/SmartFeeds/UnreadFeed.swift b/Shared/SmartFeeds/UnreadFeed.swift index c2f0af292..6ad75b7b2 100644 --- a/Shared/SmartFeeds/UnreadFeed.swift +++ b/Shared/SmartFeeds/UnreadFeed.swift @@ -42,7 +42,7 @@ final class UnreadFeed: PseudoFeed { } var smallIcon: IconImage? { - return AppAssets.unreadFeedImage + return AppImage.unreadFeed } #if os(macOS) diff --git a/iOS/Add/AddComboTableViewCell.swift b/iOS/Add/AddComboTableViewCell.swift index 0551babfd..f399264e0 100644 --- a/iOS/Add/AddComboTableViewCell.swift +++ b/iOS/Add/AddComboTableViewCell.swift @@ -16,7 +16,7 @@ final class AddComboTableViewCell: VibrantTableViewCell { override func updateVibrancy(animated: Bool) { super.updateVibrancy(animated: animated) - let iconTintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : AppAssets.secondaryAccentColor + let iconTintColor = isHighlighted || isSelected ? AppColor.vibrantText : AppColor.secondaryAccent if animated { UIView.animate(withDuration: Self.duration) { self.icon.tintColor = iconTintColor diff --git a/iOS/Add/SelectComboTableViewCell.swift b/iOS/Add/SelectComboTableViewCell.swift index 5402c5dc6..a74f1bc57 100644 --- a/iOS/Add/SelectComboTableViewCell.swift +++ b/iOS/Add/SelectComboTableViewCell.swift @@ -16,7 +16,7 @@ final class SelectComboTableViewCell: VibrantTableViewCell { override func updateVibrancy(animated: Bool) { super.updateVibrancy(animated: animated) - let iconTintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : UIColor.label + let iconTintColor = isHighlighted || isSelected ? AppColor.vibrantText : UIColor.label if animated { UIView.animate(withDuration: Self.duration) { self.icon.tintColor = iconTintColor diff --git a/iOS/AppAssets.swift b/iOS/AppAssets.swift deleted file mode 100644 index a35dbf124..000000000 --- a/iOS/AppAssets.swift +++ /dev/null @@ -1,281 +0,0 @@ -// -// AppAssets.swift -// NetNewsWire -// -// Created by Maurice Parker on 4/8/19. -// Copyright © 2019 Ranchero Software. All rights reserved. -// -import UIKit -import RSCore -import Account - -struct AppAssets { - -// static var accountBazQuxImage: UIImage = { -// return UIImage(named: "accountBazQux")! -// }() - -// static var accountCloudKitImage: UIImage = { -// return UIImage(named: "accountCloudKit")! -// }() -// -// static var accountFeedbinImage: UIImage = { -// return UIImage(named: "accountFeedbin")! -// }() -// -// static var accountFeedlyImage: UIImage = { -// return UIImage(named: "accountFeedly")! -// }() -// -// static var accountFreshRSSImage: UIImage = { -// return UIImage(named: "accountFreshRSS")! -// }() -// -// static var accountInoreaderImage: UIImage = { -// return UIImage(named: "accountInoreader")! -// }() -// -// static var accountLocalPadImage: UIImage = { -// return UIImage(named: "accountLocalPad")! -// }() -// -// static var accountLocalPhoneImage: UIImage = { -// return UIImage(named: "accountLocalPhone")! -// }() -// -// static var accountNewsBlurImage: UIImage = { -// return UIImage(named: "accountNewsBlur")! -// }() -// -// static var accountTheOldReaderImage: UIImage = { -// return UIImage(named: "accountTheOldReader")! -// }() - -// static let nnwFeedIcon = RSImage(named: "nnwFeedIcon")! - -// static var articleExtractorError: UIImage = { -// return UIImage(named: "articleExtractorError")! -// }() -// -// static var articleExtractorOff: UIImage = { -// return UIImage(named: "articleExtractorOff")! -// }() -// -// static var articleExtractorOffSF: UIImage = { -// return UIImage(systemName: "doc.plaintext")! -// }() -// -// static var articleExtractorOffTinted: UIImage = { -// let image = UIImage(named: "articleExtractorOff")! -// return image.tinted(color: AppAssets.primaryAccentColor)! -// }() -// -// static var articleExtractorOn: UIImage = { -// return UIImage(named: "articleExtractorOn")! -// }() -// -// static var articleExtractorOnSF: UIImage = { -// return UIImage(named: "articleExtractorOnSF")! -// }() -// -// static var articleExtractorOnTinted: UIImage = { -// let image = UIImage(named: "articleExtractorOn")! -// return image.tinted(color: AppAssets.primaryAccentColor)! -// }() - - static var iconBackgroundColor: UIColor = { - return UIColor(named: "iconBackgroundColor")! - }() - -// static var circleClosedImage: UIImage = { -// return UIImage(systemName: "largecircle.fill.circle")! -// }() - -// static var circleOpenImage: UIImage = { -// return UIImage(systemName: "circle")! -// }() - -// static var disclosureImage: UIImage = { -// return UIImage(named: "disclosure")! -// }() - -// static var copyImage: UIImage = { -// return UIImage(systemName: "doc.on.doc")! -// }() - -// static var deactivateImage: UIImage = { -// UIImage(systemName: "minus.circle")! -// }() - -// static var editImage: UIImage = { -// UIImage(systemName: "square.and.pencil")! -// }() - -// static var faviconTemplateImage: RSImage = { -// return RSImage(named: "faviconTemplateImage")! -// }() - -// static var filterInactiveImage: UIImage = { -// UIImage(systemName: "line.horizontal.3.decrease.circle")! -// }() - -// static var filterActiveImage: UIImage = { -// UIImage(systemName: "line.horizontal.3.decrease.circle.fill")! -// }() - -// static var folderOutlinePlus: UIImage = { -// UIImage(systemName: "folder.badge.plus")! -// }() - - static var fullScreenBackgroundColor: UIColor = { - return UIColor(named: "fullScreenBackgroundColor")! - }() - -// static var infoImage: UIImage = { -// UIImage(systemName: "info.circle")! -// }() - -// static var markAllAsReadImage: UIImage = { -// return UIImage(named: "markAllAsRead")! -// }() - -// static var markBelowAsReadImage: UIImage = { -// return UIImage(systemName: "arrowtriangle.down.circle")! -// }() - -// static var markAboveAsReadImage: UIImage = { -// return UIImage(systemName: "arrowtriangle.up.circle")! -// }() - - static var folderImage: IconImage = { - return IconImage(UIImage(systemName: "folder.fill")!, isSymbol: true, isBackgroundSuppressed: true, preferredColor: AppAssets.secondaryAccentColor.cgColor) - }() - -// static var moreImage: UIImage = { -// return UIImage(systemName: "ellipsis.circle")! -// }() - -// static var nextArticleImage: UIImage = { -// return UIImage(systemName: "chevron.down")! -// }() - -// static var nextUnreadArticleImage: UIImage = { -// return UIImage(systemName: "chevron.down.circle")! -// }() - -// static var plus: UIImage = { -// UIImage(systemName: "plus")! -// }() - -// static var prevArticleImage: UIImage = { -// return UIImage(systemName: "chevron.up")! -// }() - -// static var openInSidebarImage: UIImage = { -// return UIImage(systemName: "arrow.turn.down.left")! -// }() - - static var primaryAccentColor: UIColor { - return UIColor(named: "primaryAccentColor")! - } - -// static var safariImage: UIImage = { -// return UIImage(systemName: "safari")! -// }() - - static var searchFeedImage: IconImage = { - return IconImage(UIImage(systemName: "magnifyingglass")!, isSymbol: true) - }() - - static var secondaryAccentColor: UIColor { - return UIColor(named: "secondaryAccentColor")! - } - - static var sectionHeaderColor: UIColor = { - return UIColor(named: "sectionHeaderColor")! - }() - -// static var shareImage: UIImage = { -// return UIImage(systemName: "square.and.arrow.up")! -// }() - -// static var smartFeedImage: UIImage = { -// return UIImage(systemName: "gear")! -// }() - - static var starColor: UIColor = { - return UIColor(named: "starColor")! - }() - - static var starClosedImage: UIImage = { - return UIImage(systemName: "star.fill")! - }() - - static var starOpenImage: UIImage = { - return UIImage(systemName: "star")! - }() - - static var starredFeedImage: IconImage { - let image = UIImage(systemName: "star.fill")! - return IconImage(image, isSymbol: true, isBackgroundSuppressed: true, preferredColor: AppAssets.starColor.cgColor) - } - - static var tickMarkColor: UIColor = { - return UIColor(named: "tickMarkColor")! - }() - -// static var timelineStarImage: UIImage = { -// let image = UIImage(systemName: "star.fill")! -// return image.withTintColor(AppAssets.starColor, renderingMode: .alwaysOriginal) -// }() - - static var todayFeedImage: IconImage { - let image = UIImage(systemName: "sun.max.fill")! - return IconImage(image, isSymbol: true, isBackgroundSuppressed: true, preferredColor: UIColor.systemOrange.cgColor) - } - -// static var trashImage: UIImage = { -// return UIImage(systemName: "trash")! -// }() - - static var unreadFeedImage: IconImage { - let image = UIImage(systemName: "largecircle.fill.circle")! - return IconImage(image, isSymbol: true, isBackgroundSuppressed: true, preferredColor: AppAssets.secondaryAccentColor.cgColor) - } - - static var vibrantTextColor: UIColor = { - return UIColor(named: "vibrantTextColor")! - }() - - static var controlBackgroundColor: UIColor = { - return UIColor(named: "controlBackgroundColor")! - }() - -// static func image(for accountType: AccountType) -> UIImage? { -// switch accountType { -// case .onMyMac: -// if UIDevice.current.userInterfaceIdiom == .pad { -// return AppAssets.accountLocalPadImage -// } else { -// return AppAssets.accountLocalPhoneImage -// } -// case .cloudKit: -// return AppAssets.accountCloudKitImage -// case .feedbin: -// return AppAssets.accountFeedbinImage -// case .feedly: -// return AppAssets.accountFeedlyImage -// case .freshRSS: -// return AppAssets.accountFreshRSSImage -// case .newsBlur: -// return AppAssets.accountNewsBlurImage -// case .inoreader: -// return AppAssets.accountInoreaderImage -// case .bazQux: -// return AppAsset.accountBazQuxImage -// case .theOldReader: -// return AppAssets.accountTheOldReaderImage -// } -// } - -} diff --git a/iOS/Article/ArticleViewController.swift b/iOS/Article/ArticleViewController.swift index 3d165c780..f27e7c728 100644 --- a/iOS/Article/ArticleViewController.swift +++ b/iOS/Article/ArticleViewController.swift @@ -233,10 +233,10 @@ final class ArticleViewController: UIViewController { } if article.status.starred { - starBarButtonItem.image = AppAssets.starClosedImage + starBarButtonItem.image = AppImage.starClosed starBarButtonItem.accLabelText = NSLocalizedString("Selected - Star Article", comment: "Selected - Star Article") } else { - starBarButtonItem.image = AppAssets.starOpenImage + starBarButtonItem.image = AppImage.starOpen starBarButtonItem.accLabelText = NSLocalizedString("Star Article", comment: "Star Article") } } diff --git a/iOS/Article/ImageTransition.swift b/iOS/Article/ImageTransition.swift index 4905be749..f88da65db 100644 --- a/iOS/Article/ImageTransition.swift +++ b/iOS/Article/ImageTransition.swift @@ -41,7 +41,7 @@ final class ImageTransition: NSObject, UIViewControllerAnimatedTransitioning { let fromView = transitionContext.view(forKey: .from)! fromView.removeFromSuperview() - transitionContext.containerView.backgroundColor = AppAssets.fullScreenBackgroundColor + transitionContext.containerView.backgroundColor = AppColor.fullScreenBackground transitionContext.containerView.addSubview(imageView) webViewController?.hideClickedImage() diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index a2be2ee51..02ff10efd 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -751,7 +751,7 @@ private extension WebViewController { func toggleStarredAction() -> UIAction { let starred = article?.status.starred ?? false let title = starred ? NSLocalizedString("Mark as Unstarred", comment: "Mark as Unstarred") : NSLocalizedString("Mark as Starred", comment: "Mark as Starred") - let starredImage = starred ? AppAssets.starOpenImage : AppAssets.starClosedImage + let starredImage = starred ? AppImage.starOpen : AppImage.starClosed return UIAction(title: title, image: starredImage) { [weak self] _ in self?.coordinator.toggleStarredForCurrentArticle() } diff --git a/iOS/IconView.swift b/iOS/IconView.swift index dcec6b240..4c168884a 100644 --- a/iOS/IconView.swift +++ b/iOS/IconView.swift @@ -111,7 +111,7 @@ private extension IconView { private func updateBackgroundColor() { if !isBackgroundSuppressed && ((iconImage != nil && isVerticalBackgroundExposed) || !isDiscernable) { - backgroundColor = AppAssets.iconBackgroundColor + backgroundColor = AppColor.iconBackground } else { backgroundColor = nil } diff --git a/iOS/MainFeed/Cell/MainFeedTableViewCell.swift b/iOS/MainFeed/Cell/MainFeedTableViewCell.swift index cd800dc78..3c4eeaf61 100644 --- a/iOS/MainFeed/Cell/MainFeedTableViewCell.swift +++ b/iOS/MainFeed/Cell/MainFeedTableViewCell.swift @@ -171,12 +171,12 @@ final class MainFeedTableViewCell: VibrantTableViewCell { let iconTintColor: UIColor if isHighlighted || isSelected { - iconTintColor = AppAssets.vibrantTextColor + iconTintColor = AppColor.vibrantText } else { if let preferredColor = iconImage?.preferredColor { iconTintColor = UIColor(cgColor: preferredColor) } else { - iconTintColor = AppAssets.secondaryAccentColor + iconTintColor = AppColor.secondaryAccent } } @@ -207,7 +207,7 @@ private extension MainFeedTableViewCell { disclosureButton = NonIntrinsicButton(type: .roundedRect) disclosureButton!.addTarget(self, action: #selector(buttonPressed(_:)), for: UIControl.Event.touchUpInside) disclosureButton?.setImage(AppImage.disclosure, for: .normal) - disclosureButton?.tintColor = AppAssets.controlBackgroundColor + disclosureButton?.tintColor = AppColor.controlBackground disclosureButton?.imageView?.contentMode = .center disclosureButton?.imageView?.clipsToBounds = false disclosureButton?.addInteraction(UIPointerInteraction()) diff --git a/iOS/MainFeed/Cell/MainFeedTableViewSectionHeader.swift b/iOS/MainFeed/Cell/MainFeedTableViewSectionHeader.swift index e2318a3c9..a74df0994 100644 --- a/iOS/MainFeed/Cell/MainFeedTableViewSectionHeader.swift +++ b/iOS/MainFeed/Cell/MainFeedTableViewSectionHeader.swift @@ -203,7 +203,7 @@ private extension MainFeedTableViewSectionHeader { func addBackgroundView() { self.backgroundView = UIView(frame: self.bounds) - self.backgroundView?.backgroundColor = AppAssets.sectionHeaderColor + self.backgroundView?.backgroundColor = AppColor.sectionHeader } } diff --git a/iOS/MainFeed/Cell/MainFeedUnreadCountView.swift b/iOS/MainFeed/Cell/MainFeedUnreadCountView.swift index b59a9a10b..7048e1dfb 100644 --- a/iOS/MainFeed/Cell/MainFeedUnreadCountView.swift +++ b/iOS/MainFeed/Cell/MainFeedUnreadCountView.swift @@ -15,7 +15,7 @@ class MainFeedUnreadCountView: UIView { } let cornerRadius = 8.0 - let bgColor = AppAssets.controlBackgroundColor + let bgColor = AppColor.controlBackground var textColor: UIColor { return UIColor.white } diff --git a/iOS/MainTimeline/Cell/MainTimelineTableViewCell.swift b/iOS/MainTimeline/Cell/MainTimelineTableViewCell.swift index 3c674b1ec..28d6ccdc1 100644 --- a/iOS/MainTimeline/Cell/MainTimelineTableViewCell.swift +++ b/iOS/MainTimeline/Cell/MainTimelineTableViewCell.swift @@ -62,16 +62,16 @@ final class MainTimelineTableViewCell: VibrantTableViewCell { if animated { UIView.animate(withDuration: Self.duration) { if self.isHighlighted || self.isSelected { - self.unreadIndicatorView.backgroundColor = AppAssets.vibrantTextColor + self.unreadIndicatorView.backgroundColor = AppColor.vibrantText } else { - self.unreadIndicatorView.backgroundColor = AppAssets.secondaryAccentColor + self.unreadIndicatorView.backgroundColor = AppColor.secondaryAccent } } } else { if self.isHighlighted || self.isSelected { - self.unreadIndicatorView.backgroundColor = AppAssets.vibrantTextColor + self.unreadIndicatorView.backgroundColor = AppColor.vibrantText } else { - self.unreadIndicatorView.backgroundColor = AppAssets.secondaryAccentColor + self.unreadIndicatorView.backgroundColor = AppColor.secondaryAccent } } } diff --git a/iOS/MainTimeline/MainTimelineUnreadCountView.swift b/iOS/MainTimeline/MainTimelineUnreadCountView.swift index 657577b0f..c130fed7b 100644 --- a/iOS/MainTimeline/MainTimelineUnreadCountView.swift +++ b/iOS/MainTimeline/MainTimelineUnreadCountView.swift @@ -27,7 +27,7 @@ final class MainTimelineUnreadCountView: MainFeedUnreadCountView { let cornerRadii = CGSize(width: cornerRadius, height: cornerRadius) let rect = CGRect(x: 1, y: 1, width: bounds.width - 2, height: bounds.height - 2) let path = UIBezierPath(roundedRect: rect, byRoundingCorners: .allCorners, cornerRadii: cornerRadii) - AppAssets.primaryAccentColor.setFill() + AppColor.accent.setFill() path.fill() if unreadCount > 0 { diff --git a/iOS/MainTimeline/TimelineViewController.swift b/iOS/MainTimeline/TimelineViewController.swift index 74fb27e95..7aef5bdbf 100644 --- a/iOS/MainTimeline/TimelineViewController.swift +++ b/iOS/MainTimeline/TimelineViewController.swift @@ -283,7 +283,7 @@ final class TimelineViewController: UITableViewController, UndoableCommandRunner } readAction.image = article.status.read ? AppImage.circleClosed : AppImage.circleOpen - readAction.backgroundColor = AppAssets.primaryAccentColor + readAction.backgroundColor = AppColor.accent return UISwipeActionsConfiguration(actions: [readAction]) } @@ -302,8 +302,8 @@ final class TimelineViewController: UITableViewController, UndoableCommandRunner completion(true) } - starAction.image = article.status.starred ? AppAssets.starOpenImage : AppAssets.starClosedImage - starAction.backgroundColor = AppAssets.starColor + starAction.image = article.status.starred ? AppImage.starOpen : AppImage.starClosed + starAction.backgroundColor = AppColor.star // Set up the read action let moreTitle = NSLocalizedString("More", comment: "More") @@ -805,7 +805,7 @@ private extension TimelineViewController { let title = article.status.starred ? NSLocalizedString("Mark as Unstarred", comment: "Mark as Unstarred") : NSLocalizedString("Mark as Starred", comment: "Mark as Starred") - let image = article.status.starred ? AppAssets.starOpenImage : AppAssets.starClosedImage + let image = article.status.starred ? AppImage.starOpen : AppImage.starClosed let action = UIAction(title: title, image: image) { [weak self] _ in self?.coordinator.toggleStar(article) diff --git a/iOS/SceneDelegate.swift b/iOS/SceneDelegate.swift index 61862269f..c18d09533 100644 --- a/iOS/SceneDelegate.swift +++ b/iOS/SceneDelegate.swift @@ -19,7 +19,7 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate { func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - window!.tintColor = AppAssets.primaryAccentColor + window!.tintColor = AppColor.accent updateUserInterfaceStyle() UINavigationBar.appearance().scrollEdgeAppearance = UINavigationBarAppearance() diff --git a/iOS/Settings/SettingsComboTableViewCell.swift b/iOS/Settings/SettingsComboTableViewCell.swift index df99d19ef..3fd3a5d38 100644 --- a/iOS/Settings/SettingsComboTableViewCell.swift +++ b/iOS/Settings/SettingsComboTableViewCell.swift @@ -17,7 +17,7 @@ final class SettingsComboTableViewCell: VibrantTableViewCell { super.updateVibrancy(animated: animated) updateLabelVibrancy(comboNameLabel, color: labelColor, animated: animated) - let tintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : UIColor.label + let tintColor = isHighlighted || isSelected ? AppColor.vibrantText : UIColor.label if animated { UIView.animate(withDuration: Self.duration) { self.comboImage?.tintColor = tintColor diff --git a/iOS/Settings/TimelinePreviewTableViewController.swift b/iOS/Settings/TimelinePreviewTableViewController.swift index 8949dc394..4b5ca00ca 100644 --- a/iOS/Settings/TimelinePreviewTableViewController.swift +++ b/iOS/Settings/TimelinePreviewTableViewController.swift @@ -84,7 +84,7 @@ private extension TimelinePreviewTableViewController { status: status ) - let iconImage = IconImage(AppImage.faviconTemplate.withTintColor(AppAssets.secondaryAccentColor)) + let iconImage = IconImage(AppImage.faviconTemplate.withTintColor(AppColor.secondaryAccent)) return MainTimelineCellData( article: prototypeArticle, diff --git a/iOS/ShareExtension/ShareFolderPickerController.swift b/iOS/ShareExtension/ShareFolderPickerController.swift index ceea68435..0e5446a8f 100644 --- a/iOS/ShareExtension/ShareFolderPickerController.swift +++ b/iOS/ShareExtension/ShareFolderPickerController.swift @@ -48,7 +48,7 @@ final class ShareFolderPickerController: UITableViewController { if let account = container as? ExtensionAccount { cell.icon.image = AppImage.account(account.type) } else { - cell.icon.image = AppAssets.folderImage.image + cell.icon.image = AppImage.folder.image } cell.label?.text = container?.name ?? "" diff --git a/iOS/UIKit Extensions/InteractiveNavigationController.swift b/iOS/UIKit Extensions/InteractiveNavigationController.swift index a4e7e6bf7..9d22d6cb9 100644 --- a/iOS/UIKit Extensions/InteractiveNavigationController.swift +++ b/iOS/UIKit Extensions/InteractiveNavigationController.swift @@ -53,11 +53,11 @@ private extension InteractiveNavigationController { scrollEdgeStandardAppearance.backgroundColor = .systemBackground navigationBar.scrollEdgeAppearance = scrollEdgeStandardAppearance - navigationBar.tintColor = AppAssets.primaryAccentColor + navigationBar.tintColor = AppColor.accent let toolbarAppearance = UIToolbarAppearance() toolbar.standardAppearance = toolbarAppearance toolbar.compactAppearance = toolbarAppearance - toolbar.tintColor = AppAssets.primaryAccentColor + toolbar.tintColor = AppColor.accent } } diff --git a/iOS/UIKit Extensions/TickMarkSlider.swift b/iOS/UIKit Extensions/TickMarkSlider.swift index 1ce32d5d9..41362c8b9 100644 --- a/iOS/UIKit Extensions/TickMarkSlider.swift +++ b/iOS/UIKit Extensions/TickMarkSlider.swift @@ -36,7 +36,7 @@ final class TickMarkSlider: UISlider { let tick = UIView() tick.translatesAutoresizingMaskIntoConstraints = false - tick.backgroundColor = AppAssets.tickMarkColor + tick.backgroundColor = AppColor.tickMark insertSubview(tick, at: 0) tick.widthAnchor.constraint(equalToConstant: 3).isActive = true diff --git a/iOS/UIKit Extensions/VibrantButton.swift b/iOS/UIKit Extensions/VibrantButton.swift index 91f105e94..4c8ef0379 100644 --- a/iOS/UIKit Extensions/VibrantButton.swift +++ b/iOS/UIKit Extensions/VibrantButton.swift @@ -10,7 +10,7 @@ import UIKit final class VibrantButton: UIButton { - @IBInspectable var backgroundHighlightColor: UIColor = AppAssets.secondaryAccentColor + @IBInspectable var backgroundHighlightColor: UIColor = AppColor.secondaryAccent override init(frame: CGRect) { super.init(frame: frame) @@ -22,8 +22,8 @@ final class VibrantButton: UIButton { } private func commonInit() { - setTitleColor(AppAssets.vibrantTextColor, for: .highlighted) - let disabledColor = AppAssets.secondaryAccentColor.withAlphaComponent(0.5) + setTitleColor(AppColor.vibrantText, for: .highlighted) + let disabledColor = AppColor.secondaryAccent.withAlphaComponent(0.5) setTitleColor(disabledColor, for: .disabled) } diff --git a/iOS/UIKit Extensions/VibrantLabel.swift b/iOS/UIKit Extensions/VibrantLabel.swift index 49363ed1b..3a405ecfe 100644 --- a/iOS/UIKit Extensions/VibrantLabel.swift +++ b/iOS/UIKit Extensions/VibrantLabel.swift @@ -21,7 +21,6 @@ final class VibrantLabel: UILabel { } private func commonInit() { - highlightedTextColor = AppAssets.vibrantTextColor + highlightedTextColor = AppColor.vibrantText } - } diff --git a/iOS/UIKit Extensions/VibrantTableViewCell.swift b/iOS/UIKit Extensions/VibrantTableViewCell.swift index d4f057baf..b09b3a0e4 100644 --- a/iOS/UIKit Extensions/VibrantTableViewCell.swift +++ b/iOS/UIKit Extensions/VibrantTableViewCell.swift @@ -13,11 +13,11 @@ class VibrantTableViewCell: UITableViewCell { static let duration: TimeInterval = 0.6 var labelColor: UIColor { - return isHighlighted || isSelected ? AppAssets.vibrantTextColor : UIColor.label + return isHighlighted || isSelected ? AppColor.vibrantText : UIColor.label } var secondaryLabelColor: UIColor { - return isHighlighted || isSelected ? AppAssets.vibrantTextColor : UIColor.secondaryLabel + return isHighlighted || isSelected ? AppColor.vibrantText : UIColor.secondaryLabel } override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { @@ -47,7 +47,7 @@ class VibrantTableViewCell: UITableViewCell { /// Subclass overrides should call super func applyThemeProperties() { let selectedBackgroundView = UIView(frame: .zero) - selectedBackgroundView.backgroundColor = AppAssets.secondaryAccentColor + selectedBackgroundView.backgroundColor = AppColor.secondaryAccent self.selectedBackgroundView = selectedBackgroundView } @@ -80,7 +80,7 @@ final class VibrantBasicTableViewCell: VibrantTableViewCell { @IBInspectable var imageSelected: UIImage? var iconTint: UIColor { - return isHighlighted || isSelected ? labelColor : AppAssets.primaryAccentColor + return isHighlighted || isSelected ? labelColor : AppColor.accent } var iconImage: UIImage? {