Remove the color parameter as it's no longer needed
This commit is contained in:
parent
cc0bfd95b2
commit
37f1ebc025
|
@ -251,8 +251,8 @@ private extension TimelineTableCellView {
|
||||||
func updateTextFieldAttributedText(_ textField: NSTextField, _ text: NSAttributedString?) {
|
func updateTextFieldAttributedText(_ textField: NSTextField, _ text: NSAttributedString?) {
|
||||||
var s = text ?? NSAttributedString(string: "")
|
var s = text ?? NSAttributedString(string: "")
|
||||||
|
|
||||||
if let fieldFont = textField.font, let color = textField.textColor {
|
if let fieldFont = textField.font {
|
||||||
s = s.adding(font: fieldFont, color: color)
|
s = s.adding(font: fieldFont)
|
||||||
}
|
}
|
||||||
|
|
||||||
if textField.attributedStringValue != s {
|
if textField.attributedStringValue != s {
|
||||||
|
|
|
@ -34,15 +34,10 @@ extension NSAttributedString {
|
||||||
///
|
///
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - baseFont: The font to add.
|
/// - baseFont: The font to add.
|
||||||
/// - color: The color to add.
|
func adding(font baseFont: Font) -> NSAttributedString {
|
||||||
func adding(font baseFont: Font, color: Color? = nil) -> NSAttributedString {
|
|
||||||
let mutable = self.mutableCopy() as! NSMutableAttributedString
|
let mutable = self.mutableCopy() as! NSMutableAttributedString
|
||||||
let fullRange = NSRange(location: 0, length: mutable.length)
|
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 size = baseFont.pointSize
|
||||||
let baseDescriptor = baseFont.fontDescriptor
|
let baseDescriptor = baseFont.fontDescriptor
|
||||||
let baseSymbolicTraits = baseDescriptor.symbolicTraits
|
let baseSymbolicTraits = baseDescriptor.symbolicTraits
|
||||||
|
|
Loading…
Reference in New Issue