Flatten AppAsset — the inner structs were too cute.

This commit is contained in:
Brent Simmons 2024-09-30 22:16:54 -07:00
parent c88dc18644
commit 2ae6eaba9f
25 changed files with 119 additions and 120 deletions

View File

@ -31,7 +31,7 @@ extension AppAsset {
static let openInBrowser = RSImage.systemImage("safari")
static let readClosed = RSImage.systemImage("largecircle.fill.circle")
static let readOpen = RSImage.systemImage("circle")
static let share = AppAsset.share
static let share = AppAsset.shareImage
}
struct PreferencesToolbar {

View File

@ -167,7 +167,7 @@ import Sparkle
os_log(.debug, "Is first run.")
}
FaviconGenerator.faviconTemplateImage = AppAsset.faviconTemplate
FaviconGenerator.faviconTemplateImage = AppAsset.faviconTemplateImage
importFeedsIfNeeded()
updateSortMenuItems()

View File

@ -25,16 +25,16 @@ final class ArticleExtractorButton: NSButton {
switch buttonState {
case .error:
stripAnimatedSublayer()
image = AppAsset.ArticleExtractor.error
image = AppAsset.articleExtractorErrorImage
case .animated:
image = nil
needsLayout = true
case .on:
stripAnimatedSublayer()
image = AppAsset.ArticleExtractor.on
image = AppAsset.articleExtractorOnImage
case .off:
stripAnimatedSublayer()
image = AppAsset.ArticleExtractor.off
image = AppAsset.articleExtractorOffImage
}
}
}
@ -66,7 +66,7 @@ final class ArticleExtractorButton: NSButton {
private func commonInit() {
wantsLayer = true
bezelStyle = .texturedRounded
image = AppAsset.ArticleExtractor.off
image = AppAsset.articleExtractorOffImage
imageScaling = .scaleProportionallyDown
widthAnchor.constraint(equalTo: heightAnchor).isActive = true
}
@ -85,12 +85,12 @@ final class ArticleExtractorButton: NSButton {
}
private func addAnimatedSublayer(to hostedLayer: CALayer) {
let image1 = AppAsset.ArticleExtractor.off.tinted(with: NSColor.controlTextColor)
let image2 = AppAsset.ArticleExtractor.on.tinted(with: NSColor.controlTextColor)
let image1 = AppAsset.articleExtractorOffImage.tinted(with: NSColor.controlTextColor)
let image2 = AppAsset.articleExtractorOnImage.tinted(with: NSColor.controlTextColor)
let images = [image1, image2, image1]
animatedLayer = CALayer()
let imageSize = AppAsset.ArticleExtractor.off.size
let imageSize = AppAsset.articleExtractorOffImage.size
animatedLayer!.bounds = CGRect(x: 0, y: 0, width: imageSize.width, height: imageSize.height)
animatedLayer!.position = CGPoint(x: bounds.midX, y: bounds.midY)

View File

@ -813,11 +813,11 @@ extension MainWindowController: NSToolbarDelegate {
case .markAllAsRead:
let title = NSLocalizedString("Mark All as Read", comment: "Mark All as Read")
return buildToolbarButton(.markAllAsRead, title, AppAsset.markAllAsRead, "markAllAsRead:")
return buildToolbarButton(.markAllAsRead, title, AppAsset.markAllAsReadImage, "markAllAsRead:")
case .toggleReadArticlesFilter:
let title = NSLocalizedString("Read Articles Filter", comment: "Read Articles Filter")
return buildToolbarButton(.toggleReadArticlesFilter, title, AppAsset.filterInactive, "toggleReadArticlesFilter:")
return buildToolbarButton(.toggleReadArticlesFilter, title, AppAsset.filterInactiveImage, "toggleReadArticlesFilter:")
case .timelineTrackingSeparator:
return NSTrackingSeparatorToolbarItem(identifier: .timelineTrackingSeparator, splitView: splitViewController!.splitView, dividerIndex: 1)
@ -1190,7 +1190,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 = AppAsset.filterInactive
button.image = AppAsset.filterInactiveImage
}
return false
}
@ -1199,13 +1199,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 = AppAsset.filterActive
button.image = AppAsset.filterActiveImage
}
} else {
(item as? NSMenuItem)?.title = hideCommand
if let toolbarItem = item as? NSToolbarItem, let button = toolbarItem.view as? NSButton {
toolbarItem.toolTip = hideCommand
button.image = AppAsset.filterInactive
button.image = AppAsset.filterInactiveImage
}
}

View File

@ -210,9 +210,9 @@ private extension TimelineContainerViewController {
readFilteredButton.isHidden = false
if isReadFiltered {
readFilteredButton.image = AppAsset.filterActive
readFilteredButton.image = AppAsset.filterActiveImage
} else {
readFilteredButton.image = AppAsset.filterInactive
readFilteredButton.image = AppAsset.filterInactiveImage
}
}

View File

@ -40,23 +40,23 @@ class AccountsReaderAPIWindowController: NSWindowController {
if let accountType = accountType {
switch accountType {
case .freshRSS:
titleImageView.image = AppAsset.Account.freshRSS
titleImageView.image = AppAsset.freshRSSImage
titleLabel.stringValue = NSLocalizedString("Sign in to your FreshRSS account.", comment: "FreshRSS")
noAccountTextField.stringValue = NSLocalizedString("Dont have a FreshRSS instance?", comment: "No FreshRSS")
createAccountButton.title = NSLocalizedString("Find out more", comment: "No FreshRSS Button")
apiURLTextField.placeholderString = NSLocalizedString("fresh.rss.net/api/greader.php", comment: "FreshRSS API Helper")
case .inoreader:
titleImageView.image = AppAsset.Account.inoReader
titleImageView.image = AppAsset.inoReaderImage
titleLabel.stringValue = NSLocalizedString("Sign in to your InoReader account.", comment: "InoReader")
gridView.row(at: 2).isHidden = true
noAccountTextField.stringValue = NSLocalizedString("Dont have an InoReader account?", comment: "No InoReader")
case .bazQux:
titleImageView.image = AppAsset.Account.bazQux
titleImageView.image = AppAsset.bazQuxImage
titleLabel.stringValue = NSLocalizedString("Sign in to your BazQux account.", comment: "BazQux")
gridView.row(at: 2).isHidden = true
noAccountTextField.stringValue = NSLocalizedString("Dont have a BazQux account?", comment: "No BazQux")
case .theOldReader:
titleImageView.image = AppAsset.Account.theOldReader
titleImageView.image = AppAsset.theOldReaderImage
titleLabel.stringValue = NSLocalizedString("Sign in to your The Old Reader account.", comment: "The Old Reader")
gridView.row(at: 2).isHidden = true
noAccountTextField.stringValue = NSLocalizedString("Dont have a The Old Reader account?", comment: "No OldReader")

View File

@ -18,13 +18,13 @@ import Images
final class AppAsset {
static let markAllAsRead = RSImage.appImage("markAllAsRead")
static let faviconTemplate = RSImage.appImage("faviconTemplateImage")
static let share = RSImage.systemImage("square.and.arrow.up")
static let markAllAsReadImage = RSImage.appImage("markAllAsRead")
static let faviconTemplateImage = RSImage.appImage("faviconTemplateImage")
static let shareImage = RSImage.systemImage("square.and.arrow.up")
static let starColor = RSColor(named: "starColor")!
@MainActor static let folder: IconImage = {
@MainActor static let folderIcon: IconImage = {
#if os(macOS)
let image = RSImage.systemImage("folder")
@ -42,76 +42,75 @@ final class AppAsset {
@MainActor static let searchFeedImage: IconImage = {
#if os(macOS)
#if os(macOS)
IconImage(NSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true, isBackgroundSupressed: true)
#else
#else
IconImage(UIImage(systemName: "magnifyingglass")!, isSymbol: true)
#endif
#endif
}()
// MARK: - Account
struct Account {
static let bazQuxImage = RSImage.appImage("accountBazQux")
static let cloudKitImage = RSImage.appImage("accountCloudKit")
static let feedbinImage = RSImage.appImage("accountFeedbin")
static let feedlyImage = RSImage.appImage("accountFeedly")
static let freshRSSImage = RSImage.appImage("accountFreshRSS")
static let inoReaderImage = RSImage.appImage("accountInoreader")
static let localAccountMacImage = RSImage.appImage("accountLocal")
static let localAccountPadImage = RSImage.appImage("accountLocalPad")
static let localAccountPhoneImage = RSImage.appImage("accountLocalPhone")
static let newsBlurImage = RSImage.appImage("accountNewsBlur")
static let theOldReaderImage = RSImage.appImage("accountTheOldReader")
static let bazQux = RSImage.appImage("accountBazQux")
static let cloudKit = RSImage.appImage("accountCloudKit")
static let feedbin = RSImage.appImage("accountFeedbin")
static let feedly = RSImage.appImage("accountFeedly")
static let freshRSS = RSImage.appImage("accountFreshRSS")
static let inoReader = RSImage.appImage("accountInoreader")
static let local = RSImage.appImage("accountLocal")
static let localPad = RSImage.appImage("accountLocalPad")
static let localPhone = RSImage.appImage("accountLocalPhone")
static let newsBlur = RSImage.appImage("accountNewsBlur")
static let theOldReader = RSImage.appImage("accountTheOldReader")
@MainActor static func accountImage(for accountType: AccountType) -> RSImage {
@MainActor static func image(for accountType: AccountType) -> RSImage {
switch accountType {
case .onMyMac:
switch accountType {
case .onMyMac:
#if os(macOS)
return AppAsset.localAccountMacImage
#if os(macOS)
return AppAsset.Account.local
#elseif os(iOS)
if UIDevice.current.userInterfaceIdiom == .pad {
return AppAsset.Account.localPad
} else {
return AppAsset.Account.localPhone
}
#endif
case .cloudKit:
return AppAsset.Account.cloudKit
case .bazQux:
return AppAsset.Account.bazQux
case .feedbin:
return AppAsset.Account.feedbin
case .feedly:
return AppAsset.Account.feedly
case .freshRSS:
return AppAsset.Account.freshRSS
case .inoreader:
return AppAsset.Account.inoReader
case .newsBlur:
return AppAsset.Account.newsBlur
case .theOldReader:
return AppAsset.Account.theOldReader
#elseif os(iOS)
if UIDevice.current.userInterfaceIdiom == .pad {
return AppAsset.localAccountPadImage
} else {
return AppAsset.localAccountPhoneImage
}
#endif
case .cloudKit:
return AppAsset.cloudKitImage
case .bazQux:
return AppAsset.bazQuxImage
case .feedbin:
return AppAsset.feedbinImage
case .feedly:
return AppAsset.feedlyImage
case .freshRSS:
return AppAsset.freshRSSImage
case .inoreader:
return AppAsset.inoReaderImage
case .newsBlur:
return AppAsset.newsBlurImage
case .theOldReader:
return AppAsset.theOldReaderImage
}
}
struct ArticleExtractor {
static let error = RSImage.appImage("articleExtractorError")
static let off = RSImage.appImage("articleExtractorOff")
static let offSF = RSImage.systemImage("doc.plaintext")
static let on = RSImage.appImage("articleExtractorOn")
static let onSF = RSImage.appImage("articleExtractorOnSF")
}
static let filterActive = RSImage.systemImage("line.horizontal.3.decrease.circle.fill")
static let filterInactive = RSImage.systemImage("line.horizontal.3.decrease.circle")
// MARK: - ArticleExtractor
static let articleExtractorErrorImage = RSImage.appImage("articleExtractorError")
static let articleExtractorOffImage = RSImage.appImage("articleExtractorOff")
static let articleExtractorOffSFImage = RSImage.systemImage("doc.plaintext")
static let articleExtractorOnImage = RSImage.appImage("articleExtractorOn")
static let articleExtractorOnSFImage = RSImage.appImage("articleExtractorOnSF")
// MARK: - Filter icon
static let filterActiveImage = RSImage.systemImage("line.horizontal.3.decrease.circle.fill")
static let filterInactiveImage = RSImage.systemImage("line.horizontal.3.decrease.circle")
}

View File

@ -18,7 +18,7 @@ protocol SmallIconProvider {
extension Account: SmallIconProvider {
var smallIcon: IconImage? {
let image = AppAsset.Account.image(for: accountType)
let image = AppAsset.accountImage(for: accountType)
return IconImage(image)
}
}
@ -35,6 +35,6 @@ extension Feed: SmallIconProvider {
extension Folder: SmallIconProvider {
var smallIcon: IconImage? {
AppAsset.folder
AppAsset.folderIcon
}
}

View File

@ -56,7 +56,7 @@ class CloudKitAccountViewController: UITableViewController {
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 0 {
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
headerView.imageView.image = AppAsset.Account.image(for: .cloudKit)
headerView.imageView.image = AppAsset.accountImage(for: .cloudKit)
return headerView
} else {
return super.tableView(tableView, viewForHeaderInSection: section)

View File

@ -69,7 +69,7 @@ class FeedbinAccountViewController: UITableViewController {
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 0 {
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
headerView.imageView.image = AppAsset.Account.image(for: .feedbin)
headerView.imageView.image = AppAsset.accountImage(for: .feedbin)
return headerView
} else {
return super.tableView(tableView, viewForHeaderInSection: section)

View File

@ -46,7 +46,7 @@ class LocalAccountViewController: UITableViewController {
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 0 {
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
headerView.imageView.image = AppAsset.Account.image(for: .onMyMac)
headerView.imageView.image = AppAsset.accountImage(for: .onMyMac)
return headerView
} else {
return super.tableView(tableView, viewForHeaderInSection: section)

View File

@ -63,7 +63,7 @@ class NewsBlurAccountViewController: UITableViewController {
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 0 {
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
headerView.imageView.image = AppAsset.Account.image(for: .newsBlur)
headerView.imageView.image = AppAsset.accountImage(for: .newsBlur)
return headerView
} else {
return super.tableView(tableView, viewForHeaderInSection: section)

View File

@ -230,13 +230,13 @@ class ReaderAPIAccountViewController: UITableViewController {
if let accountType = accountType {
switch accountType {
case .bazQux:
return AppAsset.Account.bazQux
return AppAsset.bazQuxImage
case .inoreader:
return AppAsset.Account.inoReader
return AppAsset.inoReaderImage
case .theOldReader:
return AppAsset.Account.theOldReader
return AppAsset.theOldReaderImage
case .freshRSS:
return AppAsset.Account.freshRSS
return AppAsset.freshRSSImage
default:
return nil
}

View File

@ -73,7 +73,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationC
os_log(.debug, "Is first run.")
}
FaviconGenerator.faviconTemplateImage = AppAsset.faviconTemplate
FaviconGenerator.faviconTemplateImage = AppAsset.faviconTemplateImage
importFeedsIfNeeded()

View File

@ -25,16 +25,16 @@ enum ArticleExtractorButtonState {
switch buttonState {
case .error:
stripAnimatedSublayer()
setImage(AppAsset.ArticleExtractor.error, for: .normal)
setImage(AppAsset.articleExtractorErrorImage, for: .normal)
case .animated:
setImage(nil, for: .normal)
setNeedsLayout()
case .on:
stripAnimatedSublayer()
setImage(AppAsset.ArticleExtractor.on, for: .normal)
setImage(AppAsset.articleExtractorOnImage, for: .normal)
case .off:
stripAnimatedSublayer()
setImage(AppAsset.ArticleExtractor.off, for: .normal)
setImage(AppAsset.articleExtractorOffImage, for: .normal)
}
}
}
@ -77,7 +77,7 @@ enum ArticleExtractorButtonState {
let images = [image1, image2, image1]
animatedLayer = CALayer()
let imageSize = AppAsset.ArticleExtractor.off.size
let imageSize = AppAsset.articleExtractorOffImage.size
animatedLayer!.bounds = CGRect(x: 0, y: 0, width: imageSize.width, height: imageSize.height)
animatedLayer!.position = CGPoint(x: bounds.midX, y: bounds.midY)

View File

@ -40,7 +40,7 @@ final class ArticleViewController: UIViewController {
private var articleExtractorButton: ArticleExtractorButton = {
let button = ArticleExtractorButton(type: .system)
button.frame = CGRect(x: 0, y: 0, width: 44.0, height: 44.0)
button.setImage(AppAsset.ArticleExtractor.off, for: .normal)
button.setImage(AppAsset.articleExtractorOffImage, for: .normal)
return button
}()

View File

@ -860,7 +860,7 @@ private extension WebViewController {
func toggleArticleExtractorAction() -> UIAction {
let extracted = articleExtractorButtonState == .on
let title = extracted ? NSLocalizedString("Show Feed Article", comment: "Show Feed Article") : NSLocalizedString("Show Reader View", comment: "Show Reader View")
let extractorImage = extracted ? AppAsset.ArticleExtractor.offSF : AppAsset.ArticleExtractor.onSF
let extractorImage = extracted ? AppAsset.articleExtractorOffSFImage : AppAsset.articleExtractorOnSFImage
return UIAction(title: title, image: extractorImage) { [weak self] action in
self?.toggleArticleExtractor()
}
@ -868,7 +868,7 @@ private extension WebViewController {
func shareAction() -> UIAction {
let title = NSLocalizedString("Share", comment: "Share")
return UIAction(title: title, image: AppAsset.share) { [weak self] action in
return UIAction(title: title, image: AppAsset.shareImage) { [weak self] action in
self?.showActivityDialog()
}
}

View File

@ -705,12 +705,12 @@ private extension SidebarViewController {
}
func setFilterButtonToActive() {
filterButton?.image = AppAsset.filterActive
filterButton?.image = AppAsset.filterActiveImage
filterButton?.accLabelText = NSLocalizedString("Selected - Filter Read Feeds", comment: "Selected - Filter Read Feeds")
}
func setFilterButtonToInactive() {
filterButton?.image = AppAsset.filterInactive
filterButton?.image = AppAsset.filterInactiveImage
filterButton?.accLabelText = NSLocalizedString("Filter Read Feeds", comment: "Filter Read Feeds")
}
@ -1101,7 +1101,7 @@ private extension SidebarViewController {
let localizedMenuText = NSLocalizedString("Mark All as Read in “%@”", comment: "Command")
let title = NSString.localizedStringWithFormat(localizedMenuText as NSString, feed.nameForDisplay) as String
let action = UIAction(title: title, image: AppAsset.markAllAsRead) { [weak self] action in
let action = UIAction(title: title, image: AppAsset.markAllAsReadImage) { [weak self] action in
MarkAsReadAlertController.confirm(self, coordinator: self?.coordinator, confirmTitle: title, sourceType: contentView) { [weak self] in
Task { @MainActor in
@ -1122,7 +1122,7 @@ private extension SidebarViewController {
let localizedMenuText = NSLocalizedString("Mark All as Read in “%@”", comment: "Command")
let title = NSString.localizedStringWithFormat(localizedMenuText as NSString, account.nameForDisplay) as String
let action = UIAction(title: title, image: AppAsset.markAllAsRead) { [weak self] action in
let action = UIAction(title: title, image: AppAsset.markAllAsReadImage) { [weak self] action in
MarkAsReadAlertController.confirm(self, coordinator: self?.coordinator, confirmTitle: title, sourceType: contentView) { [weak self] in
// If you don't have this delay the screen flashes when it executes this code
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {

View File

@ -33,7 +33,7 @@ final class IconView: UIView {
private var isDiscernable = true
private let imageView: UIImageView = {
let imageView = NonIntrinsicImageView(image: AppAsset.faviconTemplate)
let imageView = NonIntrinsicImageView(image: AppAsset.faviconTemplateImage)
imageView.contentMode = .scaleAspectFit
imageView.clipsToBounds = true
imageView.layer.cornerRadius = 2.0

View File

@ -154,7 +154,7 @@ extension AccountInspectorViewController {
if section == 0 {
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
headerView.imageView.image = AppAsset.Account.image(for: account.accountType)
headerView.imageView.image = AppAsset.accountImage(for: account.accountType)
return headerView
} else {
return super.tableView(tableView, viewForHeaderInSection: section)

View File

@ -133,17 +133,17 @@ final class AddAccountViewController: UITableViewController, AddAccountDismissDe
switch indexPath.section {
case AddAccountSections.local.rawValue:
cell.comboNameLabel?.text = AddAccountSections.local.sectionContent[indexPath.row].localizedAccountName()
cell.comboImage?.image = AppAsset.Account.image(for: .onMyMac)
cell.comboImage?.image = AppAsset.accountImage(for: .onMyMac)
case AddAccountSections.icloud.rawValue:
cell.comboNameLabel?.text = AddAccountSections.icloud.sectionContent[indexPath.row].localizedAccountName()
cell.comboImage?.image = AppAsset.Account.image(for: AddAccountSections.icloud.sectionContent[indexPath.row])
cell.comboImage?.image = AppAsset.accountImage(for: AddAccountSections.icloud.sectionContent[indexPath.row])
if AppDefaults.shared.isDeveloperBuild || AccountManager.shared.accounts.contains(where: { $0.accountType == .cloudKit }) {
cell.isUserInteractionEnabled = false
cell.comboNameLabel?.isEnabled = false
}
case AddAccountSections.web.rawValue:
cell.comboNameLabel?.text = AddAccountSections.web.sectionContent[indexPath.row].localizedAccountName()
cell.comboImage?.image = AppAsset.Account.image(for: AddAccountSections.web.sectionContent[indexPath.row])
cell.comboImage?.image = AppAsset.accountImage(for: AddAccountSections.web.sectionContent[indexPath.row])
let type = AddAccountSections.web.sectionContent[indexPath.row]
if (type == .feedly || type == .inoreader) && AppDefaults.shared.isDeveloperBuild {
cell.isUserInteractionEnabled = false
@ -151,8 +151,8 @@ final class AddAccountViewController: UITableViewController, AddAccountDismissDe
}
case AddAccountSections.selfhosted.rawValue:
cell.comboNameLabel?.text = AddAccountSections.selfhosted.sectionContent[indexPath.row].localizedAccountName()
cell.comboImage?.image = AppAsset.Account.image(for: AddAccountSections.selfhosted.sectionContent[indexPath.row])
cell.comboImage?.image = AppAsset.accountImage(for: AddAccountSections.selfhosted.sectionContent[indexPath.row])
default:
return cell
}

View File

@ -146,7 +146,7 @@ final class SettingsViewController: UITableViewController {
let acctCell = tableView.dequeueReusableCell(withIdentifier: "SettingsComboTableViewCell", for: indexPath) as! SettingsComboTableViewCell
acctCell.applyThemeProperties()
let account = sortedAccounts[indexPath.row]
acctCell.comboImage?.image = AppAsset.Account.image(for: account.accountType)
acctCell.comboImage?.image = AppAsset.accountImage(for: account.accountType)
acctCell.comboNameLabel?.text = account.nameForDisplay
cell = acctCell
}

View File

@ -70,7 +70,7 @@ private extension TimelinePreviewTableViewController {
let status = ArticleStatus(articleID: prototypeID, read: false, starred: false, dateArrived: Date())
let prototypeArticle = Article(accountID: prototypeID, articleID: prototypeID, feedID: prototypeID, uniqueID: prototypeID, title: longTitle, contentHTML: nil, contentText: nil, url: nil, externalURL: nil, summary: nil, imageURL: nil, datePublished: nil, dateModified: nil, authors: nil, status: status)
let iconImage = IconImage(AppAsset.faviconTemplate.withTintColor(AppAssets.secondaryAccentColor))
let iconImage = IconImage(AppAsset.faviconTemplateImage.withTintColor(AppAssets.secondaryAccentColor))
return TimelineCellData(article: prototypeArticle, showFeedName: .feed, feedName: "Feed Name", byline: nil, iconImage: iconImage, showIcon: true, featuredImage: nil, numberOfLines: AppDefaults.shared.timelineNumberOfLines, iconSize: AppDefaults.shared.timelineIconSize)
}

View File

@ -47,9 +47,9 @@ class ShareFolderPickerController: UITableViewController {
}()
if let account = container as? ExtensionAccount {
cell.icon.image = AppAsset.Account.image(for: account.type)
cell.icon.image = AppAsset.accountImage(for: account.type)
} else {
cell.icon.image = AppAsset.folder.image
cell.icon.image = AppAsset.folderIcon.image
}
cell.label?.text = container?.name ?? ""

View File

@ -63,7 +63,7 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner {
NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil)
// Initialize Programmatic Buttons
filterButton = UIBarButtonItem(image: AppAsset.filterInactive, style: .plain, target: self, action: #selector(toggleFilter(_:)))
filterButton = UIBarButtonItem(image: AppAsset.filterInactiveImage, style: .plain, target: self, action: #selector(toggleFilter(_:)))
firstUnreadButton = UIBarButtonItem(image: AppAssets.nextUnreadArticleImage, style: .plain, target: self, action: #selector(firstUnread(_:)))
// Setup the Search Controller
@ -656,10 +656,10 @@ private extension TimelineViewController {
}
if coordinator.isReadArticlesFiltered {
filterButton?.image = AppAsset.filterActive
filterButton?.image = AppAsset.filterActiveImage
filterButton?.accLabelText = NSLocalizedString("Selected - Filter Read Articles", comment: "Selected - Filter Read Articles")
} else {
filterButton?.image = AppAsset.filterInactive
filterButton?.image = AppAsset.filterInactiveImage
filterButton?.accLabelText = NSLocalizedString("Filter Read Articles", comment: "Filter Read Articles")
}
@ -886,7 +886,7 @@ private extension TimelineViewController {
let localizedMenuText = NSLocalizedString("Mark All as Read in “%@”", comment: "Command")
let title = NSString.localizedStringWithFormat(localizedMenuText as NSString, feed.nameForDisplay) as String
let action = UIAction(title: title, image: AppAsset.markAllAsRead) { [weak self] action in
let action = UIAction(title: title, image: AppAsset.markAllAsReadImage) { [weak self] action in
MarkAsReadAlertController.confirm(self, coordinator: self?.coordinator, confirmTitle: title, sourceType: contentView) { [weak self] in
Task { @MainActor in
@ -984,7 +984,7 @@ private extension TimelineViewController {
func shareAction(_ article: Article, indexPath: IndexPath) -> UIAction? {
guard let url = article.preferredURL else { return nil }
let title = NSLocalizedString("Share", comment: "Share")
let action = UIAction(title: title, image: AppAsset.share) { [weak self] action in
let action = UIAction(title: title, image: AppAsset.shareImage) { [weak self] action in
self?.shareDialogForTableCell(indexPath: indexPath, url: url, title: article.title)
}
return action