Remove a number of instances of the word master.

This commit is contained in:
Brent Simmons 2024-11-14 20:05:37 -08:00
parent 44fbcd85b6
commit 45d6981215
7 changed files with 45 additions and 45 deletions

View File

@ -77,7 +77,7 @@ final class IconView: UIView {
private extension IconView { private extension IconView {
func commonInit() { func commonInit() {
layer.cornerRadius = MasterTimelineDefaultCellLayout.iconCornerRadius layer.cornerRadius = TimelineDefaultCellLayout.iconCornerRadius
clipsToBounds = true clipsToBounds = true
addSubview(imageView) addSubview(imageView)
} }

View File

@ -157,24 +157,24 @@ private extension MasterTimelineTableViewCell {
if UIApplication.shared.preferredContentSizeCategory.isAccessibilityCategory { if UIApplication.shared.preferredContentSizeCategory.isAccessibilityCategory {
return TimelineAccessibilityCellLayout(width: width, insets: safeAreaInsets, cellData: cellData) return TimelineAccessibilityCellLayout(width: width, insets: safeAreaInsets, cellData: cellData)
} else { } else {
return MasterTimelineDefaultCellLayout(width: width, insets: safeAreaInsets, cellData: cellData) return TimelineDefaultCellLayout(width: width, insets: safeAreaInsets, cellData: cellData)
} }
} }
func updateTitleView() { func updateTitleView() {
titleView.font = MasterTimelineDefaultCellLayout.titleFont titleView.font = TimelineDefaultCellLayout.titleFont
titleView.textColor = labelColor titleView.textColor = labelColor
updateTextFieldAttributedText(titleView, cellData?.attributedTitle) updateTextFieldAttributedText(titleView, cellData?.attributedTitle)
} }
func updateSummaryView() { func updateSummaryView() {
summaryView.font = MasterTimelineDefaultCellLayout.summaryFont summaryView.font = TimelineDefaultCellLayout.summaryFont
summaryView.textColor = labelColor summaryView.textColor = labelColor
updateTextFieldText(summaryView, cellData?.summary) updateTextFieldText(summaryView, cellData?.summary)
} }
func updateDateView() { func updateDateView() {
dateView.font = MasterTimelineDefaultCellLayout.dateFont dateView.font = TimelineDefaultCellLayout.dateFont
dateView.textColor = secondaryLabelColor dateView.textColor = secondaryLabelColor
updateTextFieldText(dateView, cellData.dateString) updateTextFieldText(dateView, cellData.dateString)
} }
@ -204,12 +204,12 @@ private extension MasterTimelineTableViewCell {
switch cellData.showFeedName { switch cellData.showFeedName {
case .feed: case .feed:
showView(feedNameView) showView(feedNameView)
feedNameView.font = MasterTimelineDefaultCellLayout.feedNameFont feedNameView.font = TimelineDefaultCellLayout.feedNameFont
feedNameView.textColor = secondaryLabelColor feedNameView.textColor = secondaryLabelColor
updateTextFieldText(feedNameView, cellData.feedName) updateTextFieldText(feedNameView, cellData.feedName)
case .byline: case .byline:
showView(feedNameView) showView(feedNameView)
feedNameView.font = MasterTimelineDefaultCellLayout.feedNameFont feedNameView.font = TimelineDefaultCellLayout.feedNameFont
feedNameView.textColor = secondaryLabelColor feedNameView.textColor = secondaryLabelColor
updateTextFieldText(feedNameView, cellData.byline) updateTextFieldText(feedNameView, cellData.byline)
case .none: case .none:

View File

@ -23,15 +23,15 @@ struct TimelineAccessibilityCellLayout: TimelineCellLayout {
init(width: CGFloat, insets: UIEdgeInsets, cellData: MasterTimelineCellData) { init(width: CGFloat, insets: UIEdgeInsets, cellData: MasterTimelineCellData) {
var currentPoint = CGPoint.zero var currentPoint = CGPoint.zero
currentPoint.x = MasterTimelineDefaultCellLayout.cellPadding.left + insets.left + MasterTimelineDefaultCellLayout.unreadCircleMarginLeft currentPoint.x = TimelineDefaultCellLayout.cellPadding.left + insets.left + TimelineDefaultCellLayout.unreadCircleMarginLeft
currentPoint.y = MasterTimelineDefaultCellLayout.cellPadding.top currentPoint.y = TimelineDefaultCellLayout.cellPadding.top
// Unread Indicator and Star // Unread Indicator and Star
self.unreadIndicatorRect = TimelineAccessibilityCellLayout.rectForUnreadIndicator(currentPoint) self.unreadIndicatorRect = TimelineAccessibilityCellLayout.rectForUnreadIndicator(currentPoint)
self.starRect = TimelineAccessibilityCellLayout.rectForStar(currentPoint) self.starRect = TimelineAccessibilityCellLayout.rectForStar(currentPoint)
// Start the point at the beginning position of the main block // Start the point at the beginning position of the main block
currentPoint.x += MasterTimelineDefaultCellLayout.unreadCircleDimension + MasterTimelineDefaultCellLayout.unreadCircleMarginRight currentPoint.x += TimelineDefaultCellLayout.unreadCircleDimension + TimelineDefaultCellLayout.unreadCircleMarginRight
// Icon Image // Icon Image
if cellData.showIcon { if cellData.showIcon {
@ -41,7 +41,7 @@ struct TimelineAccessibilityCellLayout: TimelineCellLayout {
self.iconImageRect = CGRect.zero self.iconImageRect = CGRect.zero
} }
let textAreaWidth = width - (currentPoint.x + MasterTimelineDefaultCellLayout.cellPadding.right + insets.right) let textAreaWidth = width - (currentPoint.x + TimelineDefaultCellLayout.cellPadding.right + insets.right)
// Title Text Block // Title Text Block
let (titleRect, numberOfLinesForTitle) = TimelineAccessibilityCellLayout.rectForTitle(cellData, currentPoint, textAreaWidth) let (titleRect, numberOfLinesForTitle) = TimelineAccessibilityCellLayout.rectForTitle(cellData, currentPoint, textAreaWidth)
@ -49,7 +49,7 @@ struct TimelineAccessibilityCellLayout: TimelineCellLayout {
// Summary Text Block // Summary Text Block
if self.titleRect != CGRect.zero { if self.titleRect != CGRect.zero {
currentPoint.y = self.titleRect.maxY + MasterTimelineDefaultCellLayout.titleBottomMargin currentPoint.y = self.titleRect.maxY + TimelineDefaultCellLayout.titleBottomMargin
} }
self.summaryRect = TimelineAccessibilityCellLayout.rectForSummary(cellData, currentPoint, textAreaWidth, numberOfLinesForTitle) self.summaryRect = TimelineAccessibilityCellLayout.rectForSummary(cellData, currentPoint, textAreaWidth, numberOfLinesForTitle)
@ -65,7 +65,7 @@ struct TimelineAccessibilityCellLayout: TimelineCellLayout {
// Feed Name and Pub Date // Feed Name and Pub Date
self.dateRect = TimelineAccessibilityCellLayout.rectForDate(cellData, currentPoint, textAreaWidth) self.dateRect = TimelineAccessibilityCellLayout.rectForDate(cellData, currentPoint, textAreaWidth)
self.height = self.dateRect.maxY + MasterTimelineDefaultCellLayout.cellPadding.bottom self.height = self.dateRect.maxY + TimelineDefaultCellLayout.cellPadding.bottom
} }
@ -79,7 +79,7 @@ private extension TimelineAccessibilityCellLayout {
var r = CGRect.zero var r = CGRect.zero
let size = SingleLineUILabelSizer.size(for: cellData.dateString, font: MasterTimelineDefaultCellLayout.dateFont) let size = SingleLineUILabelSizer.size(for: cellData.dateString, font: TimelineDefaultCellLayout.dateFont)
r.size = size r.size = size
r.origin = point r.origin = point

View File

@ -25,7 +25,7 @@ extension TimelineCellLayout {
static func rectForUnreadIndicator(_ point: CGPoint) -> CGRect { static func rectForUnreadIndicator(_ point: CGPoint) -> CGRect {
var r = CGRect.zero var r = CGRect.zero
r.size = CGSize(width: MasterTimelineDefaultCellLayout.unreadCircleDimension, height: MasterTimelineDefaultCellLayout.unreadCircleDimension) r.size = CGSize(width: TimelineDefaultCellLayout.unreadCircleDimension, height: TimelineDefaultCellLayout.unreadCircleDimension)
r.origin.x = point.x r.origin.x = point.x
r.origin.y = point.y + 5 r.origin.y = point.y + 5
return r return r
@ -34,9 +34,9 @@ extension TimelineCellLayout {
static func rectForStar(_ point: CGPoint) -> CGRect { static func rectForStar(_ point: CGPoint) -> CGRect {
var r = CGRect.zero var r = CGRect.zero
r.size.width = MasterTimelineDefaultCellLayout.starDimension r.size.width = TimelineDefaultCellLayout.starDimension
r.size.height = MasterTimelineDefaultCellLayout.starDimension r.size.height = TimelineDefaultCellLayout.starDimension
r.origin.x = floor(point.x - ((MasterTimelineDefaultCellLayout.starDimension - MasterTimelineDefaultCellLayout.unreadCircleDimension) / 2.0)) r.origin.x = floor(point.x - ((TimelineDefaultCellLayout.starDimension - TimelineDefaultCellLayout.unreadCircleDimension) / 2.0))
r.origin.y = point.y + 3 r.origin.y = point.y + 3
return r return r
} }
@ -58,7 +58,7 @@ extension TimelineCellLayout {
r.origin = point r.origin = point
let sizeInfo = MultilineUILabelSizer.size(for: cellData.title, font: MasterTimelineDefaultCellLayout.titleFont, numberOfLines: cellData.numberOfLines, width: Int(textAreaWidth)) let sizeInfo = MultilineUILabelSizer.size(for: cellData.title, font: TimelineDefaultCellLayout.titleFont, numberOfLines: cellData.numberOfLines, width: Int(textAreaWidth))
r.size.width = textAreaWidth r.size.width = textAreaWidth
r.size.height = sizeInfo.size.height r.size.height = sizeInfo.size.height
@ -81,7 +81,7 @@ extension TimelineCellLayout {
r.origin = point r.origin = point
let sizeInfo = MultilineUILabelSizer.size(for: cellData.summary, font: MasterTimelineDefaultCellLayout.summaryFont, numberOfLines: linesLeft, width: Int(textAreaWidth)) let sizeInfo = MultilineUILabelSizer.size(for: cellData.summary, font: TimelineDefaultCellLayout.summaryFont, numberOfLines: linesLeft, width: Int(textAreaWidth))
r.size.width = textAreaWidth r.size.width = textAreaWidth
r.size.height = sizeInfo.size.height r.size.height = sizeInfo.size.height
@ -99,7 +99,7 @@ extension TimelineCellLayout {
r.origin = point r.origin = point
let feedName = cellData.showFeedName == .feed ? cellData.feedName : cellData.byline let feedName = cellData.showFeedName == .feed ? cellData.feedName : cellData.byline
let size = SingleLineUILabelSizer.size(for: feedName, font: MasterTimelineDefaultCellLayout.feedNameFont) let size = SingleLineUILabelSizer.size(for: feedName, font: TimelineDefaultCellLayout.feedNameFont)
r.size = size r.size = size
if r.size.width > textAreaWidth { if r.size.width > textAreaWidth {

View File

@ -1,5 +1,5 @@
// //
// MasterTimelineDefaultCellLayout.swift // TimelineDefaultCellLayout.swift
// NetNewsWire // NetNewsWire
// //
// Created by Brent Simmons on 2/6/16. // Created by Brent Simmons on 2/6/16.
@ -9,17 +9,17 @@
import UIKit import UIKit
import RSCore import RSCore
struct MasterTimelineDefaultCellLayout: TimelineCellLayout { struct TimelineDefaultCellLayout: TimelineCellLayout {
static let cellPadding = UIEdgeInsets(top: 12, left: 8, bottom: 12, right: 20) static let cellPadding = UIEdgeInsets(top: 12, left: 8, bottom: 12, right: 20)
static let unreadCircleMarginLeft = CGFloat(integerLiteral: 0) static let unreadCircleMarginLeft = CGFloat(integerLiteral: 0)
static let unreadCircleDimension = CGFloat(integerLiteral: 12) static let unreadCircleDimension = CGFloat(integerLiteral: 12)
static let unreadCircleSize = CGSize(width: MasterTimelineDefaultCellLayout.unreadCircleDimension, height: MasterTimelineDefaultCellLayout.unreadCircleDimension) static let unreadCircleSize = CGSize(width: TimelineDefaultCellLayout.unreadCircleDimension, height: TimelineDefaultCellLayout.unreadCircleDimension)
static let unreadCircleMarginRight = CGFloat(integerLiteral: 8) static let unreadCircleMarginRight = CGFloat(integerLiteral: 8)
static let starDimension = CGFloat(integerLiteral: 16) static let starDimension = CGFloat(integerLiteral: 16)
static let starSize = CGSize(width: MasterTimelineDefaultCellLayout.starDimension, height: MasterTimelineDefaultCellLayout.starDimension) static let starSize = CGSize(width: TimelineDefaultCellLayout.starDimension, height: TimelineDefaultCellLayout.starDimension)
static let iconMarginRight = CGFloat(integerLiteral: 8) static let iconMarginRight = CGFloat(integerLiteral: 8)
static let iconCornerRadius = CGFloat(integerLiteral: 4) static let iconCornerRadius = CGFloat(integerLiteral: 4)
@ -55,52 +55,52 @@ struct MasterTimelineDefaultCellLayout: TimelineCellLayout {
init(width: CGFloat, insets: UIEdgeInsets, cellData: MasterTimelineCellData) { init(width: CGFloat, insets: UIEdgeInsets, cellData: MasterTimelineCellData) {
var currentPoint = CGPoint.zero var currentPoint = CGPoint.zero
currentPoint.x = MasterTimelineDefaultCellLayout.cellPadding.left + insets.left + MasterTimelineDefaultCellLayout.unreadCircleMarginLeft currentPoint.x = TimelineDefaultCellLayout.cellPadding.left + insets.left + TimelineDefaultCellLayout.unreadCircleMarginLeft
currentPoint.y = MasterTimelineDefaultCellLayout.cellPadding.top currentPoint.y = TimelineDefaultCellLayout.cellPadding.top
// Unread Indicator and Star // Unread Indicator and Star
self.unreadIndicatorRect = MasterTimelineDefaultCellLayout.rectForUnreadIndicator(currentPoint) self.unreadIndicatorRect = TimelineDefaultCellLayout.rectForUnreadIndicator(currentPoint)
self.starRect = MasterTimelineDefaultCellLayout.rectForStar(currentPoint) self.starRect = TimelineDefaultCellLayout.rectForStar(currentPoint)
// Start the point at the beginning position of the main block // Start the point at the beginning position of the main block
currentPoint.x += MasterTimelineDefaultCellLayout.unreadCircleDimension + MasterTimelineDefaultCellLayout.unreadCircleMarginRight currentPoint.x += TimelineDefaultCellLayout.unreadCircleDimension + TimelineDefaultCellLayout.unreadCircleMarginRight
// Icon Image // Icon Image
if cellData.showIcon { if cellData.showIcon {
self.iconImageRect = MasterTimelineDefaultCellLayout.rectForIconView(currentPoint, iconSize: cellData.iconSize) self.iconImageRect = TimelineDefaultCellLayout.rectForIconView(currentPoint, iconSize: cellData.iconSize)
currentPoint.x = self.iconImageRect.maxX + MasterTimelineDefaultCellLayout.iconMarginRight currentPoint.x = self.iconImageRect.maxX + TimelineDefaultCellLayout.iconMarginRight
} else { } else {
self.iconImageRect = CGRect.zero self.iconImageRect = CGRect.zero
} }
let textAreaWidth = width - (currentPoint.x + MasterTimelineDefaultCellLayout.cellPadding.right + insets.right) let textAreaWidth = width - (currentPoint.x + TimelineDefaultCellLayout.cellPadding.right + insets.right)
// Title Text Block // Title Text Block
let (titleRect, numberOfLinesForTitle) = MasterTimelineDefaultCellLayout.rectForTitle(cellData, currentPoint, textAreaWidth) let (titleRect, numberOfLinesForTitle) = TimelineDefaultCellLayout.rectForTitle(cellData, currentPoint, textAreaWidth)
self.titleRect = titleRect self.titleRect = titleRect
// Summary Text Block // Summary Text Block
if self.titleRect != CGRect.zero { if self.titleRect != CGRect.zero {
currentPoint.y = self.titleRect.maxY + MasterTimelineDefaultCellLayout.titleBottomMargin currentPoint.y = self.titleRect.maxY + TimelineDefaultCellLayout.titleBottomMargin
} }
self.summaryRect = MasterTimelineDefaultCellLayout.rectForSummary(cellData, currentPoint, textAreaWidth, numberOfLinesForTitle) self.summaryRect = TimelineDefaultCellLayout.rectForSummary(cellData, currentPoint, textAreaWidth, numberOfLinesForTitle)
var y = [self.titleRect, self.summaryRect].maxY() var y = [self.titleRect, self.summaryRect].maxY()
if y == 0 { if y == 0 {
y = iconImageRect.origin.y + iconImageRect.height y = iconImageRect.origin.y + iconImageRect.height
// Necessary calculation of either feed name or date since we are working with dynamic font-sizes // Necessary calculation of either feed name or date since we are working with dynamic font-sizes
let tmp = MasterTimelineDefaultCellLayout.rectForDate(cellData, currentPoint, textAreaWidth) let tmp = TimelineDefaultCellLayout.rectForDate(cellData, currentPoint, textAreaWidth)
y -= tmp.height y -= tmp.height
} }
currentPoint.y = y currentPoint.y = y
// Feed Name and Pub Date // Feed Name and Pub Date
self.dateRect = MasterTimelineDefaultCellLayout.rectForDate(cellData, currentPoint, textAreaWidth) self.dateRect = TimelineDefaultCellLayout.rectForDate(cellData, currentPoint, textAreaWidth)
let feedNameWidth = textAreaWidth - (MasterTimelineDefaultCellLayout.feedRightMargin + self.dateRect.size.width) let feedNameWidth = textAreaWidth - (TimelineDefaultCellLayout.feedRightMargin + self.dateRect.size.width)
self.feedNameRect = MasterTimelineDefaultCellLayout.rectForFeedName(cellData, currentPoint, feedNameWidth) self.feedNameRect = TimelineDefaultCellLayout.rectForFeedName(cellData, currentPoint, feedNameWidth)
self.height = [self.iconImageRect, self.feedNameRect].maxY() + MasterTimelineDefaultCellLayout.cellPadding.bottom self.height = [self.iconImageRect, self.feedNameRect].maxY() + TimelineDefaultCellLayout.cellPadding.bottom
} }
@ -108,13 +108,13 @@ struct MasterTimelineDefaultCellLayout: TimelineCellLayout {
// MARK: - Calculate Rects // MARK: - Calculate Rects
extension MasterTimelineDefaultCellLayout { extension TimelineDefaultCellLayout {
static func rectForDate(_ cellData: MasterTimelineCellData, _ point: CGPoint, _ textAreaWidth: CGFloat) -> CGRect { static func rectForDate(_ cellData: MasterTimelineCellData, _ point: CGPoint, _ textAreaWidth: CGFloat) -> CGRect {
var r = CGRect.zero var r = CGRect.zero
let size = SingleLineUILabelSizer.size(for: cellData.dateString, font: MasterTimelineDefaultCellLayout.dateFont) let size = SingleLineUILabelSizer.size(for: cellData.dateString, font: TimelineDefaultCellLayout.dateFont)
r.size = size r.size = size
r.origin.x = (point.x + textAreaWidth) - size.width r.origin.x = (point.x + textAreaWidth) - size.width
r.origin.y = point.y r.origin.y = point.y

View File

@ -552,7 +552,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
let layout = TimelineAccessibilityCellLayout(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 tableView.estimatedRowHeight = layout.height
} else { } else {
let layout = MasterTimelineDefaultCellLayout(width: tableView.bounds.width, insets: tableView.safeAreaInsets, cellData: prototypeCellData) let layout = TimelineDefaultCellLayout(width: tableView.bounds.width, insets: tableView.safeAreaInsets, cellData: prototypeCellData)
tableView.estimatedRowHeight = layout.height tableView.estimatedRowHeight = layout.height
} }

View File

@ -26,7 +26,7 @@ class TimelinePreviewTableViewController: UIViewController, UITableViewDelegate,
let layout = TimelineAccessibilityCellLayout(width: width, insets: tableView.safeAreaInsets, cellData: prototypeCellData) let layout = TimelineAccessibilityCellLayout(width: width, insets: tableView.safeAreaInsets, cellData: prototypeCellData)
return layout.height return layout.height
} else { } else {
let layout = MasterTimelineDefaultCellLayout(width: width, insets: tableView.safeAreaInsets, cellData: prototypeCellData) let layout = TimelineDefaultCellLayout(width: width, insets: tableView.safeAreaInsets, cellData: prototypeCellData)
return layout.height return layout.height
} }
} }