From 37f1ebc0259e62e97d09d696286f1283d0c24fe4 Mon Sep 17 00:00:00 2001 From: Nate Weaver Date: Fri, 1 May 2020 01:44:23 -0500 Subject: [PATCH] Remove the color parameter as it's no longer needed --- Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift | 4 ++-- Shared/Extensions/NSAttributedString+NetNewsWire.swift | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift b/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift index 3151a7d3c..4dabd647c 100644 --- a/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift +++ b/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift @@ -251,8 +251,8 @@ private extension TimelineTableCellView { func updateTextFieldAttributedText(_ textField: NSTextField, _ text: NSAttributedString?) { var s = text ?? NSAttributedString(string: "") - if let fieldFont = textField.font, let color = textField.textColor { - s = s.adding(font: fieldFont, color: color) + if let fieldFont = textField.font { + s = s.adding(font: fieldFont) } if textField.attributedStringValue != s { diff --git a/Shared/Extensions/NSAttributedString+NetNewsWire.swift b/Shared/Extensions/NSAttributedString+NetNewsWire.swift index 349b6c096..090b0d1e4 100644 --- a/Shared/Extensions/NSAttributedString+NetNewsWire.swift +++ b/Shared/Extensions/NSAttributedString+NetNewsWire.swift @@ -34,15 +34,10 @@ extension NSAttributedString { /// /// - Parameters: /// - baseFont: The font to add. - /// - color: The color to add. - func adding(font baseFont: Font, color: Color? = nil) -> NSAttributedString { + func adding(font baseFont: Font) -> NSAttributedString { let mutable = self.mutableCopy() as! NSMutableAttributedString let fullRange = NSRange(location: 0, length: mutable.length) - if let color = color { - mutable.addAttribute(.foregroundColor, value: color as Any, range: fullRange) - } - let size = baseFont.pointSize let baseDescriptor = baseFont.fontDescriptor let baseSymbolicTraits = baseDescriptor.symbolicTraits