diff --git a/Mac/AppAssets.swift b/Mac/AppAssets.swift deleted file mode 100644 index 9c09c9d79..000000000 --- a/Mac/AppAssets.swift +++ /dev/null @@ -1,69 +0,0 @@ -// -// AppAssets.swift -// NetNewsWire -// -// Created by Brent Simmons on 2/17/18. -// Copyright © 2018 Ranchero Software. All rights reserved. -// - -import AppKit -import Core -import Account -import Images - -extension AppAsset { - - struct Mac { - - struct Timeline { - static let swipeMarkRead = NSImage(systemSymbolName: "circle", accessibilityDescription: "Mark Read")! - .withSymbolConfiguration(.init(scale: .large)) - static let swipeMarkUnread = NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: "Mark Unread")! - .withSymbolConfiguration(.init(scale: .large)) - static let swipeMarkStarred = NSImage(systemSymbolName: "star.fill", accessibilityDescription: "Star")! - .withSymbolConfiguration(.init(scale: .large)) - static let swipeMarkUnstarred = NSImage(systemSymbolName: "star", accessibilityDescription: "Unstar")! - .withSymbolConfiguration(.init(scale: .large))! - static let starSelected = RSImage.appImage("timelineStar").tinted(with: .white) - static let starUnselected = RSImage.appImage("timelineStar").tinted(with: AppAsset.starColor) - static let separatorColor = NSColor(named: "timelineSeparatorColor")! - } - } -} - - -struct AppAssets { - - @MainActor - static let searchFeedImage: IconImage = { - return IconImage(NSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true, isBackgroundSupressed: true) - }() - - static let starClosedImage = NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)! - - static let starOpenImage = NSImage(systemSymbolName: "star", accessibilityDescription: nil)! - - @MainActor - static let starredFeedImage: IconImage = { - let image = NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)! - let preferredColor = AppAsset.starColor - let coloredImage = image.tinted(with: preferredColor) - return IconImage(coloredImage, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) - }() - - @MainActor - static let 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, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) - }() - - @MainActor - static let 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, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) - }() -} diff --git a/Mac/MainWindow/MainWindowController.swift b/Mac/MainWindow/MainWindowController.swift index 09bceefe2..3a8fd5d57 100644 --- a/Mac/MainWindow/MainWindowController.swift +++ b/Mac/MainWindow/MainWindowController.swift @@ -799,7 +799,7 @@ extension MainWindowController: NSToolbarDelegate { case .markStar: let title = NSLocalizedString("Star", comment: "Star") - return buildToolbarButton(.markStar, title, AppAssets.starOpenImage, "toggleStarred:") + return buildToolbarButton(.markStar, title, AppAsset.starOpenImage, "toggleStarred:") case .nextUnread: let title = NSLocalizedString("Next Unread", comment: "Next Unread") @@ -1135,7 +1135,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 ? AppAsset.starOpenImage : AppAsset.starClosedImage } return result diff --git a/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift b/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift index 2fb854431..b60836259 100644 --- a/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift +++ b/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift @@ -19,7 +19,7 @@ final class TimelineTableCellView: NSTableCellView { private lazy var iconView = IconView() - private var starView = TimelineTableCellView.imageView(with: AppAsset.Mac.Timeline.starUnselected, scaling: .scaleNone) + private var starView = TimelineTableCellView.imageView(with: AppAsset.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 = AppAsset.Mac.Timeline.starSelected + starView.image = AppAsset.timelineStarSelected } else { - starView.image = AppAsset.Mac.Timeline.starUnselected + starView.image = AppAsset.timelineStarUnselected } showOrHideView(starView, !cellData.starred) } diff --git a/Mac/MainWindow/Timeline/TimelineTableRowView.swift b/Mac/MainWindow/Timeline/TimelineTableRowView.swift index 05ddf92c8..ab58d6d3e 100644 --- a/Mac/MainWindow/Timeline/TimelineTableRowView.swift +++ b/Mac/MainWindow/Timeline/TimelineTableRowView.swift @@ -59,7 +59,7 @@ class TimelineTableRowView : NSTableRowView { separator = NSView() separator!.translatesAutoresizingMaskIntoConstraints = false separator!.wantsLayer = true - separator!.layer?.backgroundColor = AppAsset.Mac.Timeline.separatorColor.cgColor + separator!.layer?.backgroundColor = AppAsset.timelineSeparatorColor.cgColor addSubview(separator!) diff --git a/Mac/MainWindow/Timeline/TimelineViewController.swift b/Mac/MainWindow/Timeline/TimelineViewController.swift index 0a080427a..bac778c55 100644 --- a/Mac/MainWindow/Timeline/TimelineViewController.swift +++ b/Mac/MainWindow/Timeline/TimelineViewController.swift @@ -945,7 +945,7 @@ extension TimelineViewController: NSTableViewDelegate { self.toggleArticleRead(article); tableView.rowActionsVisible = false } - action.image = article.status.read ? AppAsset.Mac.Timeline.swipeMarkUnread : AppAsset.Mac.Timeline.swipeMarkRead + action.image = article.status.read ? AppAsset.timelineSwipeMarkUnread : AppAsset.timelineSwipeMarkRead return [action] case .trailing: @@ -954,7 +954,7 @@ extension TimelineViewController: NSTableViewDelegate { tableView.rowActionsVisible = false } action.backgroundColor = AppAsset.starColor - action.image = article.status.starred ? AppAsset.Mac.Timeline.swipeMarkUnstarred : AppAsset.Mac.Timeline.swipeMarkStarred + action.image = article.status.starred ? AppAsset.timelineSwipeMarkUnstarred : AppAsset.timelineSwipeMarkStarred return [action] @unknown default: diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index b3bcdc895..83bcc2cb4 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -352,6 +352,8 @@ 845122712B8CEA9100480DB0 /* SidebarItemIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8451226D2B8CEA9100480DB0 /* SidebarItemIdentifier.swift */; }; 845122722B8CEA9100480DB0 /* SidebarItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8451226E2B8CEA9100480DB0 /* SidebarItem.swift */; }; 845122742B8CEA9100480DB0 /* SidebarItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8451226E2B8CEA9100480DB0 /* SidebarItem.swift */; }; + 845382042CD33B0400B3FBA3 /* AppAsset-Mac.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845382032CD33B0400B3FBA3 /* AppAsset-Mac.swift */; }; + 845382062CD33B6200B3FBA3 /* AppAsset-iOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845382052CD33B6200B3FBA3 /* AppAsset-iOS.swift */; }; 845479881FEB77C000AD8B59 /* TimelineKeyboardShortcuts.plist in Resources */ = {isa = PBXBuildFile; fileRef = 845479871FEB77C000AD8B59 /* TimelineKeyboardShortcuts.plist */; }; 8454C3F3263F2D8700E3F9C7 /* IconImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8454C3F2263F2D8700E3F9C7 /* IconImageCache.swift */; }; 8454C3F8263F3AD400E3F9C7 /* IconImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8454C3F2263F2D8700E3F9C7 /* IconImageCache.swift */; }; @@ -413,7 +415,6 @@ 849C64681ED37A5D003D8FC0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 849C64671ED37A5D003D8FC0 /* Assets.xcassets */; }; 849C78902362AAFC009A71E4 /* ExportOPMLSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 849C78872362AAFB009A71E4 /* ExportOPMLSheet.xib */; }; 849C78922362AB04009A71E4 /* ExportOPMLWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849C78912362AB04009A71E4 /* ExportOPMLWindowController.swift */; }; - 849EE70F203919360082A1EA /* AppAssets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849EE70E203919360082A1EA /* AppAssets.swift */; }; 849EE72120391F560082A1EA /* SharingServicePickerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849EE72020391F560082A1EA /* SharingServicePickerDelegate.swift */; }; 84A059DB2C3A49560041209B /* ReaderAPI in Resources */ = {isa = PBXBuildFile; fileRef = 84A059D92C3A49550041209B /* ReaderAPI */; }; 84A059DC2C3A49560041209B /* ReaderAPI in Resources */ = {isa = PBXBuildFile; fileRef = 84A059D92C3A49550041209B /* ReaderAPI */; }; @@ -967,6 +968,8 @@ 844B5B681FEA20DF00C7C76A /* SidebarKeyboardShortcuts.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = SidebarKeyboardShortcuts.plist; sourceTree = ""; }; 8451226D2B8CEA9100480DB0 /* SidebarItemIdentifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SidebarItemIdentifier.swift; path = Shared/SidebarItem/SidebarItemIdentifier.swift; sourceTree = SOURCE_ROOT; }; 8451226E2B8CEA9100480DB0 /* SidebarItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SidebarItem.swift; path = Shared/SidebarItem/SidebarItem.swift; sourceTree = SOURCE_ROOT; }; + 845382032CD33B0400B3FBA3 /* AppAsset-Mac.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppAsset-Mac.swift"; sourceTree = ""; }; + 845382052CD33B6200B3FBA3 /* AppAsset-iOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppAsset-iOS.swift"; sourceTree = ""; }; 845479871FEB77C000AD8B59 /* TimelineKeyboardShortcuts.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = TimelineKeyboardShortcuts.plist; sourceTree = ""; }; 8454C3F2263F2D8700E3F9C7 /* IconImageCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconImageCache.swift; sourceTree = ""; }; 845A29211FC9251E007B49E3 /* SidebarCellLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarCellLayout.swift; sourceTree = ""; }; @@ -1023,7 +1026,6 @@ 849C64711ED37A5D003D8FC0 /* NetNewsWireTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NetNewsWireTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 849C78872362AAFB009A71E4 /* ExportOPMLSheet.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ExportOPMLSheet.xib; sourceTree = ""; }; 849C78912362AB04009A71E4 /* ExportOPMLWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExportOPMLWindowController.swift; sourceTree = ""; }; - 849EE70E203919360082A1EA /* AppAssets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppAssets.swift; sourceTree = ""; }; 849EE72020391F560082A1EA /* SharingServicePickerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharingServicePickerDelegate.swift; sourceTree = ""; }; 84A059D92C3A49550041209B /* ReaderAPI */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = ReaderAPI; sourceTree = ""; }; 84A059DD2C3A49D80041209B /* Images */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Images; sourceTree = ""; }; @@ -2001,7 +2003,6 @@ 848363062262A3DD00DA1D35 /* Main.storyboard */, 84C9FC6622629B3900D921D6 /* AppDelegate.swift */, 84E46C7C1F75EF7B005ECFB3 /* AppDefaults.swift */, - 849EE70E203919360082A1EA /* AppAssets.swift */, 842E45DC1ED8C54B000A8B52 /* Browser.swift */, 51E3EB32229AB02C00645299 /* ErrorHandler.swift */, 842E45E11ED8C681000A8B52 /* MainWindow */, @@ -2025,6 +2026,8 @@ 84DC5FFD2BCE37A300F04682 /* AppDelegate+Shared.swift */, 842E45CD1ED8C308000A8B52 /* AppNotifications.swift */, 8417E6332C3B913200C75D84 /* AppAsset.swift */, + 845382032CD33B0400B3FBA3 /* AppAsset-Mac.swift */, + 845382052CD33B6200B3FBA3 /* AppAsset-iOS.swift */, 511B9805237DCAC90028BCAA /* UserInfoKey.swift */, 844933D12BA953590068AC51 /* ArticlePathInfo.swift */, 8454C3F2263F2D8700E3F9C7 /* IconImageCache.swift */, @@ -3120,6 +3123,7 @@ 51C45294226509C800C03939 /* SearchFeedDelegate.swift in Sources */, 5F323809231DF9F000706F6B /* VibrantTableViewCell.swift in Sources */, 51FE10042345529D0056195D /* UserNotificationManager.swift in Sources */, + 845382062CD33B6200B3FBA3 /* AppAsset-iOS.swift in Sources */, 845122712B8CEA9100480DB0 /* SidebarItemIdentifier.swift in Sources */, 51A66685238075AE00CB272D /* AddFeedDefaultContainer.swift in Sources */, 176813E92564BAE200D98635 /* WidgetDeepLinks.swift in Sources */, @@ -3307,7 +3311,6 @@ 1710B9132552354E00679C0D /* AddAccountHelpView.swift in Sources */, 5108F6B62375E612001ABC45 /* CacheCleaner.swift in Sources */, 849A97981ED9EFAA007D329B /* Node-Extensions.swift in Sources */, - 849EE70F203919360082A1EA /* AppAssets.swift in Sources */, 849A97531ED9EAC0007D329B /* AddFeedController.swift in Sources */, 5183CCE8226F68D90010922C /* AccountRefreshTimer.swift in Sources */, 849A97831ED9EC63007D329B /* SidebarStatusBarView.swift in Sources */, @@ -3369,6 +3372,7 @@ 849A977F1ED9EC42007D329B /* ArticleRenderer.swift in Sources */, 84C9FC7822629E1200D921D6 /* GeneralPrefencesViewController.swift in Sources */, 179DB3CE822BFCC2D774D9F4 /* AccountsNewsBlurWindowController.swift in Sources */, + 845382042CD33B0400B3FBA3 /* AppAsset-Mac.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Shared/AppAsset-Mac.swift b/Shared/AppAsset-Mac.swift new file mode 100644 index 000000000..d6a65edde --- /dev/null +++ b/Shared/AppAsset-Mac.swift @@ -0,0 +1,86 @@ +// +// AppAsset-Mac.swift +// NetNewsWire +// +// Created by Brent Simmons on 10/30/24. +// Copyright © 2024 Ranchero Software. All rights reserved. +// + +import Foundation +import Core +import Images + +extension AppAsset { + + static let iconLightBackgroundColor = NSColor(named: "iconLightBackgroundColor")! + static let iconDarkBackgroundColor = NSColor(named: "iconDarkBackgroundColor")! + + // MARK: - Mac Share Menu + + static let marsEditImage = RSImage.appImage("MarsEditIcon") + static let microblogImage = RSImage.appImage("MicroblogIcon") + + // MARK: - Mac Toolbar + + static let toolbarAddNewSidebarItemImage = RSImage.systemImage("plus") + static let toolbarRefreshImage = RSImage.systemImage("arrow.clockwise") + static let toolbarArticleThemeImage = RSImage.systemImage("doc.richtext") + static let toolbarCleanUpImage = RSImage.systemImage("wind") + static let toolbarNextUnreadImage = RSImage.systemImage("chevron.down.circle") + static let toolbarOpenInBrowserImage = RSImage.systemImage("safari") + static let toolbarReadClosedImage = RSImage.systemImage("largecircle.fill.circle") + static let toolbarReadOpenImage = RSImage.systemImage("circle") + static let toolbarShareImage = AppAsset.shareImage + + // MARK: - Mac Preferences Toolbar + + static let preferencesToolbarAccountsImage = RSImage.systemImage("at") + static let preferencesToolbarGeneralImage = RSImage.systemImage("gearshape") + static let preferencesToolbarAdvancedImage = RSImage.systemImage("gearshape.2") + + // MARK: - Timeline + + static let timelineSwipeMarkRead = NSImage(systemSymbolName: "circle", accessibilityDescription: "Mark Read")! + .withSymbolConfiguration(.init(scale: .large)) + static let timelineSwipeMarkUnread = NSImage(systemSymbolName: "largecircle.fill.circle", accessibilityDescription: "Mark Unread")! + .withSymbolConfiguration(.init(scale: .large)) + static let timelineSwipeMarkStarred = NSImage(systemSymbolName: "star.fill", accessibilityDescription: "Star")! + .withSymbolConfiguration(.init(scale: .large)) + static let timelineSwipeMarkUnstarred = NSImage(systemSymbolName: "star", accessibilityDescription: "Unstar")! + .withSymbolConfiguration(.init(scale: .large))! + static let timelineStarSelected = RSImage.appImage("timelineStar").tinted(with: .white) + static let timelineStarUnselected = RSImage.appImage("timelineStar").tinted(with: AppAsset.starColor) + static let timelineSeparatorColor = NSColor(named: "timelineSeparatorColor")! + + static let searchFeedImage: IconImage = { + IconImage(NSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true, isBackgroundSupressed: true) + }() + + static let folderIcon: IconImage = { + let image = RSImage.systemImage("folder") + let preferredColor = NSColor(named: "AccentColor")! + let coloredImage = image.tinted(with: preferredColor) + return IconImage(coloredImage, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) + }() + + static let 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, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) + }() + + static let starredFeedImage: IconImage = { + let image = NSImage(systemSymbolName: "star.fill", accessibilityDescription: nil)! + let preferredColor = AppAsset.starColor + let coloredImage = image.tinted(with: preferredColor) + return IconImage(coloredImage, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) + }() + + static let 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, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) + }() +} diff --git a/Shared/AppAsset-iOS.swift b/Shared/AppAsset-iOS.swift new file mode 100644 index 000000000..9632df32b --- /dev/null +++ b/Shared/AppAsset-iOS.swift @@ -0,0 +1,39 @@ +// +// AppAsset-iOS.swift +// NetNewsWire-iOS +// +// Created by Brent Simmons on 10/30/24. +// Copyright © 2024 Ranchero Software. All rights reserved. +// + +import Foundation + +extension AppAsset { + + static let starClosedImage = UIImage(systemName: "star.fill")! + + static let searchFeedImage: IconImage = { + IconImage(UIImage(systemName: "magnifyingglass")!, isSymbol: true) + }() + + static let unreadFeedImage: IconImage = { + let image = UIImage(systemName: "largecircle.fill.circle")! + return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: AppAssets.secondaryAccentColor.cgColor) + }() + + static let todayFeedImage: IconImage = { + let image = UIImage(systemName: "sun.max.fill")! + return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: UIColor.systemOrange.cgColor) + }() + + static let starredFeedImage: IconImage = { + let image = UIImage(systemName: "star.fill")! + return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: AppAsset.starColor.cgColor) + }() + + static let folderIcon: IconImage = { + let image = RSImage.systemImage("folder.fill") + let preferredColor = AppAssets.secondaryAccentColor + return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) + }() +} diff --git a/Shared/AppAsset.swift b/Shared/AppAsset.swift index f6b108235..d206f5bea 100644 --- a/Shared/AppAsset.swift +++ b/Shared/AppAsset.swift @@ -16,7 +16,7 @@ import Core import Account import Images -final class AppAsset { +@MainActor final class AppAsset { static let markAllAsReadImage = RSImage.appImage("markAllAsRead") static let faviconTemplateImage = RSImage.appImage("faviconTemplateImage") @@ -24,28 +24,8 @@ final class AppAsset { static let starColor = RSColor(named: "starColor")! - @MainActor static let folderIcon: IconImage = { - -#if os(macOS) - let image = RSImage.systemImage("folder") - let preferredColor = NSColor(named: "AccentColor")! - let coloredImage = image.tinted(with: preferredColor) - return IconImage(coloredImage, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) -#else - let image = RSImage.systemImage("folder.fill") - let preferredColor = AppAssets.secondaryAccentColor - return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) -#endif - }() - - @MainActor static let searchFeedImage: IconImage = { - -#if os(macOS) - IconImage(NSImage(named: NSImage.smartBadgeTemplateName)!, isSymbol: true, isBackgroundSupressed: true) -#else - IconImage(UIImage(systemName: "magnifyingglass")!, isSymbol: true) -#endif - }() + static let starOpenImage = RSImage.systemImage("star") + static let starClosedImage = RSImage.systemImage("star.fill") // MARK: - ArticleExtractor @@ -59,11 +39,8 @@ final class AppAsset { static let filterActiveImage = RSImage.systemImage("line.horizontal.3.decrease.circle.fill") static let filterInactiveImage = RSImage.systemImage("line.horizontal.3.decrease.circle") -} -// MARK: - Account - -extension AppAsset { + // MARK: - Account static let bazQuxImage = RSImage.appImage("accountBazQux") static let cloudKitImage = RSImage.appImage("accountCloudKit") @@ -77,7 +54,7 @@ extension AppAsset { static let newsBlurImage = RSImage.appImage("accountNewsBlur") static let theOldReaderImage = RSImage.appImage("accountTheOldReader") - @MainActor static func accountImage(for accountType: AccountType) -> RSImage { + static func accountImage(for accountType: AccountType) -> RSImage { switch accountType { case .onMyMac: @@ -111,39 +88,3 @@ extension AppAsset { } } } - -#if os(macOS) - -// MARK: - Mac - -extension AppAsset { - - static let iconLightBackgroundColor = NSColor(named: "iconLightBackgroundColor")! - static let iconDarkBackgroundColor = NSColor(named: "iconDarkBackgroundColor")! - - // MARK: - Mac Share Menu - - static let marsEditImage = RSImage.appImage("MarsEditIcon") - static let microblogImage = RSImage.appImage("MicroblogIcon") - - // MARK: - Mac Toolbar - - static let toolbarAddNewSidebarItemImage = RSImage.systemImage("plus") - static let toolbarRefreshImage = RSImage.systemImage("arrow.clockwise") - static let toolbarArticleThemeImage = RSImage.systemImage("doc.richtext") - static let toolbarCleanUpImage = RSImage.systemImage("wind") - static let toolbarNextUnreadImage = RSImage.systemImage("chevron.down.circle") - static let toolbarOpenInBrowserImage = RSImage.systemImage("safari") - static let toolbarReadClosedImage = RSImage.systemImage("largecircle.fill.circle") - static let toolbarReadOpenImage = RSImage.systemImage("circle") - static let toolbarShareImage = AppAsset.shareImage - - // MARK: - Mac Preferences Toolbar - - static let preferencesToolbarAccountsImage = RSImage.systemImage("at") - static let preferencesToolbarGeneralImage = RSImage.systemImage("gearshape") - static let preferencesToolbarAdvancedImage = RSImage.systemImage("gearshape.2") -} - -#endif - diff --git a/Shared/SmartFeeds/SearchFeedDelegate.swift b/Shared/SmartFeeds/SearchFeedDelegate.swift index a913bdd1e..7e4ec3edb 100644 --- a/Shared/SmartFeeds/SearchFeedDelegate.swift +++ b/Shared/SmartFeeds/SearchFeedDelegate.swift @@ -24,7 +24,7 @@ import Images let nameForDisplayPrefix = NSLocalizedString("Search: ", comment: "Search smart feed title prefix") let searchString: String let fetchType: FetchType - var smallIcon: IconImage? = AppAssets.searchFeedImage + var smallIcon: IconImage? = AppAsset.searchFeedImage init(searchString: String) { self.searchString = searchString diff --git a/Shared/SmartFeeds/SearchTimelineFeedDelegate.swift b/Shared/SmartFeeds/SearchTimelineFeedDelegate.swift index dd933b097..700840372 100644 --- a/Shared/SmartFeeds/SearchTimelineFeedDelegate.swift +++ b/Shared/SmartFeeds/SearchTimelineFeedDelegate.swift @@ -24,7 +24,7 @@ import Images let nameForDisplayPrefix = NSLocalizedString("Search: ", comment: "Search smart feed title prefix") let searchString: String let fetchType: FetchType - var smallIcon: IconImage? = AppAssets.searchFeedImage + var smallIcon: IconImage? = AppAsset.searchFeedImage init(searchString: String, articleIDs: Set) { self.searchString = searchString diff --git a/Shared/SmartFeeds/StarredFeedDelegate.swift b/Shared/SmartFeeds/StarredFeedDelegate.swift index 0b9c06dc7..bdeee74b6 100644 --- a/Shared/SmartFeeds/StarredFeedDelegate.swift +++ b/Shared/SmartFeeds/StarredFeedDelegate.swift @@ -20,7 +20,7 @@ import Images let nameForDisplay = NSLocalizedString("Starred", comment: "Starred pseudo-feed title") let fetchType: FetchType = .starred(nil) var smallIcon: IconImage? { - return AppAssets.starredFeedImage + return AppAsset.starredFeedImage } func unreadCount(account: Account) async -> Int { diff --git a/Shared/SmartFeeds/TodayFeedDelegate.swift b/Shared/SmartFeeds/TodayFeedDelegate.swift index 21ffb7359..f8a08e550 100644 --- a/Shared/SmartFeeds/TodayFeedDelegate.swift +++ b/Shared/SmartFeeds/TodayFeedDelegate.swift @@ -20,7 +20,7 @@ import Images let nameForDisplay = NSLocalizedString("Today", comment: "Today pseudo-feed title") let fetchType = FetchType.today(nil) var smallIcon: IconImage? { - return AppAssets.todayFeedImage + return AppAsset.todayFeedImage } func unreadCount(account: Account) async -> Int { diff --git a/Shared/SmartFeeds/UnreadFeed.swift b/Shared/SmartFeeds/UnreadFeed.swift index 0c3922358..22785734d 100644 --- a/Shared/SmartFeeds/UnreadFeed.swift +++ b/Shared/SmartFeeds/UnreadFeed.swift @@ -41,7 +41,7 @@ final class UnreadFeed: PseudoFeed { } var smallIcon: IconImage? { - return AppAssets.unreadFeedImage + return AppAsset.unreadFeedImage } #if os(macOS) diff --git a/iOS/AppAssets.swift b/iOS/AppAssets.swift index 8abf86938..75c13f8e6 100644 --- a/iOS/AppAssets.swift +++ b/iOS/AppAssets.swift @@ -77,10 +77,6 @@ struct AppAssets { static let starOpenImage = UIImage(systemName: "star")! - @MainActor static let starredFeedImage: IconImage = { - let image = UIImage(systemName: "star.fill")! - return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: AppAsset.starColor.cgColor) - }() static let tickMarkColor = UIColor(named: "tickMarkColor")! @@ -89,17 +85,8 @@ struct AppAssets { return image.withTintColor(AppAsset.starColor, renderingMode: .alwaysOriginal) }() - @MainActor static let todayFeedImage: IconImage = { - let image = UIImage(systemName: "sun.max.fill")! - return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: UIColor.systemOrange.cgColor) - }() - static let trashImage = UIImage(systemName: "trash")! - @MainActor static let unreadFeedImage: IconImage = { - let image = UIImage(systemName: "largecircle.fill.circle")! - return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: AppAssets.secondaryAccentColor.cgColor) - }() static let vibrantTextColor = UIColor(named: "vibrantTextColor")!