From 44fbcd85b6850d57e6b33dcaa296bb7ab463e0fe Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Thu, 14 Nov 2024 20:04:50 -0800 Subject: [PATCH] Remove a number of instances of the word master. --- Mac/AppAssets.swift | 2 +- Shared/Extensions/SmallIconProvider.swift | 2 +- iOS/AppAssets.swift | 8 ++------ .../MasterTimelineDefaultCellLayout.swift | 2 +- .../Cell/MasterTimelineTableViewCell.swift | 4 ++-- ... => TimelineAccessibilityCellLayout.swift} | 20 +++++++++---------- ...lLayout.swift => TimelineCellLayout.swift} | 6 +++--- .../MasterTimelineViewController.swift | 2 +- .../TimelinePreviewTableViewController.swift | 2 +- .../ShareFolderPickerController.swift | 2 +- iOS/UIKit Extensions/NonIntrinsicLabel.swift | 2 +- 11 files changed, 24 insertions(+), 28 deletions(-) rename iOS/MasterTimeline/Cell/{MasterTimelineAccessibilityCellLayout.swift => TimelineAccessibilityCellLayout.swift} (67%) rename iOS/MasterTimeline/Cell/{MasterTimelineCellLayout.swift => TimelineCellLayout.swift} (96%) diff --git a/Mac/AppAssets.swift b/Mac/AppAssets.swift index 2922cdfd9..5fa2a07ce 100644 --- a/Mac/AppAssets.swift +++ b/Mac/AppAssets.swift @@ -136,7 +136,7 @@ struct AppAssets { return RSImage(named: "legacyArticleExtractorProgress4") }() - static var masterFolderImage: IconImage { + static var folderImage: IconImage { let image = NSImage(systemSymbolName: "folder", accessibilityDescription: nil)! let preferredColor = NSColor(named: "AccentColor")! let coloredImage = image.tinted(with: preferredColor) diff --git a/Shared/Extensions/SmallIconProvider.swift b/Shared/Extensions/SmallIconProvider.swift index 195650024..86d34462f 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.masterFolderImage + AppAssets.folderImage } } diff --git a/iOS/AppAssets.swift b/iOS/AppAssets.swift index b74aaa043..1892077ce 100644 --- a/iOS/AppAssets.swift +++ b/iOS/AppAssets.swift @@ -149,14 +149,10 @@ struct AppAssets { return UIImage(systemName: "arrowtriangle.up.circle")! }() - static var masterFolderImage: IconImage = { + static var folderImage: IconImage = { return IconImage(UIImage(systemName: "folder.fill")!, isSymbol: true, isBackgroundSupressed: true, preferredColor: AppAssets.secondaryAccentColor.cgColor) }() - - static var masterFolderImageNonIcon: UIImage = { - return UIImage(systemName: "folder.fill")!.withRenderingMode(.alwaysOriginal).withTintColor(.secondaryLabel) - }() - + static var moreImage: UIImage = { return UIImage(systemName: "ellipsis.circle")! }() diff --git a/iOS/MasterTimeline/Cell/MasterTimelineDefaultCellLayout.swift b/iOS/MasterTimeline/Cell/MasterTimelineDefaultCellLayout.swift index 6b2ce58ad..9367d6caa 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineDefaultCellLayout.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineDefaultCellLayout.swift @@ -9,7 +9,7 @@ import UIKit import RSCore -struct MasterTimelineDefaultCellLayout: MasterTimelineCellLayout { +struct MasterTimelineDefaultCellLayout: TimelineCellLayout { static let cellPadding = UIEdgeInsets(top: 12, left: 8, bottom: 12, right: 20) diff --git a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift index 2ec879473..277518725 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift @@ -153,9 +153,9 @@ private extension MasterTimelineTableViewCell { addSubviewAtInit(starView, hidden: true) } - func updatedLayout(width: CGFloat) -> MasterTimelineCellLayout { + func updatedLayout(width: CGFloat) -> TimelineCellLayout { if UIApplication.shared.preferredContentSizeCategory.isAccessibilityCategory { - return MasterTimelineAccessibilityCellLayout(width: width, insets: safeAreaInsets, cellData: cellData) + return TimelineAccessibilityCellLayout(width: width, insets: safeAreaInsets, cellData: cellData) } else { return MasterTimelineDefaultCellLayout(width: width, insets: safeAreaInsets, cellData: cellData) } diff --git a/iOS/MasterTimeline/Cell/MasterTimelineAccessibilityCellLayout.swift b/iOS/MasterTimeline/Cell/TimelineAccessibilityCellLayout.swift similarity index 67% rename from iOS/MasterTimeline/Cell/MasterTimelineAccessibilityCellLayout.swift rename to iOS/MasterTimeline/Cell/TimelineAccessibilityCellLayout.swift index 7441e5ae8..387428338 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineAccessibilityCellLayout.swift +++ b/iOS/MasterTimeline/Cell/TimelineAccessibilityCellLayout.swift @@ -1,5 +1,5 @@ // -// MasterTimelineAccessibilityCellLayout.swift +// TimelineAccessibilityCellLayout.swift // NetNewsWire-iOS // // Created by Maurice Parker on 4/29/19. @@ -9,7 +9,7 @@ import UIKit import RSCore -struct MasterTimelineAccessibilityCellLayout: MasterTimelineCellLayout { +struct TimelineAccessibilityCellLayout: TimelineCellLayout { let height: CGFloat let unreadIndicatorRect: CGRect @@ -27,15 +27,15 @@ struct MasterTimelineAccessibilityCellLayout: MasterTimelineCellLayout { currentPoint.y = MasterTimelineDefaultCellLayout.cellPadding.top // Unread Indicator and Star - self.unreadIndicatorRect = MasterTimelineAccessibilityCellLayout.rectForUnreadIndicator(currentPoint) - self.starRect = MasterTimelineAccessibilityCellLayout.rectForStar(currentPoint) + self.unreadIndicatorRect = TimelineAccessibilityCellLayout.rectForUnreadIndicator(currentPoint) + self.starRect = TimelineAccessibilityCellLayout.rectForStar(currentPoint) // Start the point at the beginning position of the main block currentPoint.x += MasterTimelineDefaultCellLayout.unreadCircleDimension + MasterTimelineDefaultCellLayout.unreadCircleMarginRight // Icon Image if cellData.showIcon { - self.iconImageRect = MasterTimelineAccessibilityCellLayout.rectForIconView(currentPoint, iconSize: cellData.iconSize) + self.iconImageRect = TimelineAccessibilityCellLayout.rectForIconView(currentPoint, iconSize: cellData.iconSize) currentPoint.y = self.iconImageRect.maxY } else { self.iconImageRect = CGRect.zero @@ -44,26 +44,26 @@ struct MasterTimelineAccessibilityCellLayout: MasterTimelineCellLayout { let textAreaWidth = width - (currentPoint.x + MasterTimelineDefaultCellLayout.cellPadding.right + insets.right) // Title Text Block - let (titleRect, numberOfLinesForTitle) = MasterTimelineAccessibilityCellLayout.rectForTitle(cellData, currentPoint, textAreaWidth) + let (titleRect, numberOfLinesForTitle) = TimelineAccessibilityCellLayout.rectForTitle(cellData, currentPoint, textAreaWidth) self.titleRect = titleRect // Summary Text Block if self.titleRect != CGRect.zero { currentPoint.y = self.titleRect.maxY + MasterTimelineDefaultCellLayout.titleBottomMargin } - self.summaryRect = MasterTimelineAccessibilityCellLayout.rectForSummary(cellData, currentPoint, textAreaWidth, numberOfLinesForTitle) + self.summaryRect = TimelineAccessibilityCellLayout.rectForSummary(cellData, currentPoint, textAreaWidth, numberOfLinesForTitle) currentPoint.y = [self.titleRect, self.summaryRect].maxY() if cellData.showFeedName != .none { - self.feedNameRect = MasterTimelineAccessibilityCellLayout.rectForFeedName(cellData, currentPoint, textAreaWidth) + self.feedNameRect = TimelineAccessibilityCellLayout.rectForFeedName(cellData, currentPoint, textAreaWidth) currentPoint.y = self.feedNameRect.maxY } else { self.feedNameRect = CGRect.zero } // Feed Name and Pub Date - self.dateRect = MasterTimelineAccessibilityCellLayout.rectForDate(cellData, currentPoint, textAreaWidth) + self.dateRect = TimelineAccessibilityCellLayout.rectForDate(cellData, currentPoint, textAreaWidth) self.height = self.dateRect.maxY + MasterTimelineDefaultCellLayout.cellPadding.bottom @@ -73,7 +73,7 @@ struct MasterTimelineAccessibilityCellLayout: MasterTimelineCellLayout { // MARK: - Calculate Rects -private extension MasterTimelineAccessibilityCellLayout { +private extension TimelineAccessibilityCellLayout { static func rectForDate(_ cellData: MasterTimelineCellData, _ point: CGPoint, _ textAreaWidth: CGFloat) -> CGRect { diff --git a/iOS/MasterTimeline/Cell/MasterTimelineCellLayout.swift b/iOS/MasterTimeline/Cell/TimelineCellLayout.swift similarity index 96% rename from iOS/MasterTimeline/Cell/MasterTimelineCellLayout.swift rename to iOS/MasterTimeline/Cell/TimelineCellLayout.swift index 6913a3989..38718757e 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineCellLayout.swift +++ b/iOS/MasterTimeline/Cell/TimelineCellLayout.swift @@ -1,5 +1,5 @@ // -// MasterTimelineCellLayout.swift +// TimelineCellLayout.swift // NetNewsWire-iOS // // Created by Maurice Parker on 4/29/19. @@ -8,7 +8,7 @@ import UIKit -protocol MasterTimelineCellLayout { +protocol TimelineCellLayout { var height: CGFloat {get} var unreadIndicatorRect: CGRect {get} @@ -21,7 +21,7 @@ protocol MasterTimelineCellLayout { } -extension MasterTimelineCellLayout { +extension TimelineCellLayout { static func rectForUnreadIndicator(_ point: CGPoint) -> CGRect { var r = CGRect.zero diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index 2084e40a6..ad099afdf 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -549,7 +549,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner let prototypeCellData = MasterTimelineCellData(article: prototypeArticle, showFeedName: .feed, feedName: "Prototype Feed Name", byline: nil, iconImage: nil, showIcon: false, featuredImage: nil, numberOfLines: numberOfTextLines, iconSize: iconSize) if UIApplication.shared.preferredContentSizeCategory.isAccessibilityCategory { - let layout = MasterTimelineAccessibilityCellLayout(width: tableView.bounds.width, insets: tableView.safeAreaInsets, cellData: prototypeCellData) + let layout = TimelineAccessibilityCellLayout(width: tableView.bounds.width, insets: tableView.safeAreaInsets, cellData: prototypeCellData) tableView.estimatedRowHeight = layout.height } else { let layout = MasterTimelineDefaultCellLayout(width: tableView.bounds.width, insets: tableView.safeAreaInsets, cellData: prototypeCellData) diff --git a/iOS/Settings/TimelinePreviewTableViewController.swift b/iOS/Settings/TimelinePreviewTableViewController.swift index bd06b45cb..4422abbfb 100644 --- a/iOS/Settings/TimelinePreviewTableViewController.swift +++ b/iOS/Settings/TimelinePreviewTableViewController.swift @@ -23,7 +23,7 @@ class TimelinePreviewTableViewController: UIViewController, UITableViewDelegate, func heightFor(width: CGFloat) -> CGFloat { if UIApplication.shared.preferredContentSizeCategory.isAccessibilityCategory { - let layout = MasterTimelineAccessibilityCellLayout(width: width, insets: tableView.safeAreaInsets, cellData: prototypeCellData) + let layout = TimelineAccessibilityCellLayout(width: width, insets: tableView.safeAreaInsets, cellData: prototypeCellData) return layout.height } else { let layout = MasterTimelineDefaultCellLayout(width: width, insets: tableView.safeAreaInsets, cellData: prototypeCellData) diff --git a/iOS/ShareExtension/ShareFolderPickerController.swift b/iOS/ShareExtension/ShareFolderPickerController.swift index 3d957974b..7c1319060 100644 --- a/iOS/ShareExtension/ShareFolderPickerController.swift +++ b/iOS/ShareExtension/ShareFolderPickerController.swift @@ -48,7 +48,7 @@ class ShareFolderPickerController: UITableViewController { if let account = container as? ExtensionAccount { cell.icon.image = AppAssets.image(for: account.type) } else { - cell.icon.image = AppAssets.masterFolderImage.image + cell.icon.image = AppAssets.folderImage.image } cell.label?.text = container?.name ?? "" diff --git a/iOS/UIKit Extensions/NonIntrinsicLabel.swift b/iOS/UIKit Extensions/NonIntrinsicLabel.swift index 67904fa44..3cd615f6f 100644 --- a/iOS/UIKit Extensions/NonIntrinsicLabel.swift +++ b/iOS/UIKit Extensions/NonIntrinsicLabel.swift @@ -1,5 +1,5 @@ // -// MasterTimelineLabel.swift +// NonIntrinsicLabel.swift // NetNewsWire-iOS // // Created by Maurice Parker on 4/22/19.