Continuing migrating to AppImage.

This commit is contained in:
Brent Simmons
2025-01-26 22:19:19 -08:00
parent b116c7b6e5
commit 989ecb1e0f
7 changed files with 63 additions and 54 deletions

View File

@@ -95,17 +95,17 @@ struct AppAssets {
return UIImage(systemName: "circle")!
}()
static var disclosureImage: UIImage = {
return UIImage(named: "disclosure")!
}()
// static var disclosureImage: UIImage = {
// return UIImage(named: "disclosure")!
// }()
static var copyImage: UIImage = {
return UIImage(systemName: "doc.on.doc")!
}()
// static var copyImage: UIImage = {
// return UIImage(systemName: "doc.on.doc")!
// }()
static var deactivateImage: UIImage = {
UIImage(systemName: "minus.circle")!
}()
// static var deactivateImage: UIImage = {
// UIImage(systemName: "minus.circle")!
// }()
static var editImage: UIImage = {
UIImage(systemName: "square.and.pencil")!
@@ -139,49 +139,49 @@ struct AppAssets {
// return UIImage(named: "markAllAsRead")!
// }()
static var markBelowAsReadImage: UIImage = {
return UIImage(systemName: "arrowtriangle.down.circle")!
}()
// static var markBelowAsReadImage: UIImage = {
// return UIImage(systemName: "arrowtriangle.down.circle")!
// }()
static var markAboveAsReadImage: UIImage = {
return UIImage(systemName: "arrowtriangle.up.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 moreImage: UIImage = {
// return UIImage(systemName: "ellipsis.circle")!
// }()
static var nextArticleImage: UIImage = {
return UIImage(systemName: "chevron.down")!
}()
// static var nextArticleImage: UIImage = {
// return UIImage(systemName: "chevron.down")!
// }()
static var nextUnreadArticleImage: UIImage = {
return UIImage(systemName: "chevron.down.circle")!
}()
// 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 prevArticleImage: UIImage = {
// return UIImage(systemName: "chevron.up")!
// }()
static var openInSidebarImage: UIImage = {
return UIImage(systemName: "arrow.turn.down.left")!
}()
// 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 safariImage: UIImage = {
// return UIImage(systemName: "safari")!
// }()
static var searchFeedImage: IconImage = {
return IconImage(UIImage(systemName: "magnifyingglass")!, isSymbol: true)

View File

@@ -725,7 +725,7 @@ private extension WebViewController {
func prevArticleAction() -> UIAction? {
guard coordinator.isPrevArticleAvailable else { return nil }
let title = NSLocalizedString("Previous Article", comment: "Previous Article")
return UIAction(title: title, image: AppAssets.prevArticleImage) { [weak self] _ in
return UIAction(title: title, image: AppImage.previousArticle) { [weak self] _ in
self?.coordinator.selectPrevArticle()
}
}
@@ -733,7 +733,7 @@ private extension WebViewController {
func nextArticleAction() -> UIAction? {
guard coordinator.isNextArticleAvailable else { return nil }
let title = NSLocalizedString("Next Article", comment: "Next Article")
return UIAction(title: title, image: AppAssets.nextArticleImage) { [weak self] _ in
return UIAction(title: title, image: AppImage.nextArticle) { [weak self] _ in
self?.coordinator.selectNextArticle()
}
}
@@ -760,7 +760,7 @@ private extension WebViewController {
func nextUnreadArticleAction() -> UIAction? {
guard coordinator.isAnyUnreadAvailable else { return nil }
let title = NSLocalizedString("Next Unread Article", comment: "Next Unread Article")
return UIAction(title: title, image: AppAssets.nextUnreadArticleImage) { [weak self] _ in
return UIAction(title: title, image: AppImage.nextUnreadArticle) { [weak self] _ in
self?.coordinator.selectNextUnread()
}
}

View File

@@ -206,7 +206,7 @@ private extension MainFeedTableViewCell {
func addDisclosureView() {
disclosureButton = NonIntrinsicButton(type: .roundedRect)
disclosureButton!.addTarget(self, action: #selector(buttonPressed(_:)), for: UIControl.Event.touchUpInside)
disclosureButton?.setImage(AppAssets.disclosureImage, for: .normal)
disclosureButton?.setImage(AppImage.disclosure, for: .normal)
disclosureButton?.tintColor = AppAssets.controlBackgroundColor
disclosureButton?.imageView?.contentMode = .center
disclosureButton?.imageView?.clipsToBounds = false

View File

@@ -84,7 +84,7 @@ final class MainFeedTableViewSectionHeader: UITableViewHeaderFooterView {
private lazy var disclosureButton: UIButton = {
let button = NonIntrinsicButton()
button.tintColor = UIColor.tertiaryLabel
button.setImage(AppAssets.disclosureImage, for: .normal)
button.setImage(AppImage.disclosure, for: .normal)
button.contentMode = .center
button.addInteraction(UIPointerInteraction())
button.addTarget(self, action: #selector(toggleDisclosure), for: .touchUpInside)

View File

@@ -981,7 +981,7 @@ private extension MainFeedViewController {
}
let title = NSLocalizedString("Open Home Page", comment: "Open Home Page")
let action = UIAction(title: title, image: AppAssets.safariImage) { [weak self] _ in
let action = UIAction(title: title, image: AppImage.safari) { [weak self] _ in
self?.coordinator.showBrowserForFeed(indexPath)
}
return action
@@ -1007,7 +1007,7 @@ private extension MainFeedViewController {
}
let title = NSLocalizedString("Copy Feed URL", comment: "Copy Feed URL")
let action = UIAction(title: title, image: AppAssets.copyImage) { _ in
let action = UIAction(title: title, image: AppImage.copy) { _ in
UIPasteboard.general.url = url
}
return action
@@ -1035,7 +1035,7 @@ private extension MainFeedViewController {
}
let title = NSLocalizedString("Copy Home Page URL", comment: "Copy Home Page URL")
let action = UIAction(title: title, image: AppAssets.copyImage) { _ in
let action = UIAction(title: title, image: AppImage.copy) { _ in
UIPasteboard.general.url = url
}
return action
@@ -1117,7 +1117,7 @@ private extension MainFeedViewController {
func deactivateAccountAction(account: Account) -> UIAction {
let title = NSLocalizedString("Deactivate", comment: "Deactivate")
let action = UIAction(title: title, image: AppAssets.deactivateImage) { _ in
let action = UIAction(title: title, image: AppImage.deactivate) { _ in
account.isActive = false
}
return action

View File

@@ -71,7 +71,7 @@ final class TimelineViewController: UITableViewController, UndoableCommandRunner
// Initialize Programmatic Buttons
filterButton = UIBarButtonItem(image: AppAssets.filterInactiveImage, style: .plain, target: self, action: #selector(toggleFilter(_:)))
firstUnreadButton = UIBarButtonItem(image: AppAssets.nextUnreadArticleImage, style: .plain, target: self, action: #selector(firstUnread(_:)))
firstUnreadButton = UIBarButtonItem(image: AppImage.nextUnreadArticle, style: .plain, target: self, action: #selector(firstUnread(_:)))
// Setup the Search Controller
searchController.delegate = self
@@ -352,7 +352,7 @@ final class TimelineViewController: UITableViewController, UndoableCommandRunner
}
moreAction.image = AppAssets.moreImage
moreAction.image = AppImage.more
moreAction.backgroundColor = UIColor.systemGray
return UISwipeActionsConfiguration(actions: [starAction, moreAction])
@@ -820,7 +820,7 @@ private extension TimelineViewController {
}
let title = NSLocalizedString("Mark Above as Read", comment: "Mark Above as Read")
let image = AppAssets.markAboveAsReadImage
let image = AppImage.markAboveAsRead
let action = UIAction(title: title, image: image) { [weak self] _ in
MarkAsReadAlertController.confirm(self, coordinator: self?.coordinator, confirmTitle: title, sourceType: contentView) { [weak self] in
self?.coordinator.markAboveAsRead(article)
@@ -835,7 +835,7 @@ private extension TimelineViewController {
}
let title = NSLocalizedString("Mark Below as Read", comment: "Mark Below as Read")
let image = AppAssets.markBelowAsReadImage
let image = AppImage.markBelowAsRead
let action = UIAction(title: title, image: image) { [weak self] _ in
MarkAsReadAlertController.confirm(self, coordinator: self?.coordinator, confirmTitle: title, sourceType: contentView) { [weak self] in
self?.coordinator.markBelowAsRead(article)
@@ -887,7 +887,7 @@ private extension TimelineViewController {
!coordinator.timelineFeedIsEqualTo(feed) else { return nil }
let title = NSLocalizedString("Go to Feed", comment: "Go to Feed")
let action = UIAction(title: title, image: AppAssets.openInSidebarImage) { [weak self] _ in
let action = UIAction(title: title, image: AppImage.openInSidebar) { [weak self] _ in
self?.coordinator.discloseFeed(feed, animations: [.scroll, .navigation])
}
return action
@@ -956,7 +956,7 @@ private extension TimelineViewController {
func copyArticleURLAction(_ article: Article) -> UIAction? {
guard let url = article.preferredURL else { return nil }
let title = NSLocalizedString("Copy Article URL", comment: "Copy Article URL")
let action = UIAction(title: title, image: AppAssets.copyImage) { _ in
let action = UIAction(title: title, image: AppImage.copy) { _ in
UIPasteboard.general.url = url
}
return action
@@ -965,7 +965,7 @@ private extension TimelineViewController {
func copyExternalURLAction(_ article: Article) -> UIAction? {
guard let externalLink = article.externalLink, externalLink != article.preferredLink, let url = URL(string: externalLink) else { return nil }
let title = NSLocalizedString("Copy External URL", comment: "Copy External URL")
let action = UIAction(title: title, image: AppAssets.copyImage) { _ in
let action = UIAction(title: title, image: AppImage.copy) { _ in
UIPasteboard.general.url = url
}
return action
@@ -974,7 +974,7 @@ private extension TimelineViewController {
func openInBrowserAction(_ article: Article) -> UIAction? {
guard article.preferredURL != nil else { return nil }
let title = NSLocalizedString("Open in Browser", comment: "Open in Browser")
let action = UIAction(title: title, image: AppAssets.safariImage) { [weak self] _ in
let action = UIAction(title: title, image: AppImage.safari) { [weak self] _ in
self?.coordinator.showBrowserForArticle(article)
}
return action