mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Make attributed titles work on iOS
This commit is contained in:
@@ -148,7 +148,7 @@ private extension MasterTimelineTableViewCell {
|
||||
func updateTitleView() {
|
||||
titleView.font = MasterTimelineDefaultCellLayout.titleFont
|
||||
titleView.textColor = labelColor
|
||||
updateTextFieldText(titleView, cellData?.title)
|
||||
updateTextFieldAttributedText(titleView, cellData?.attributedTitle)
|
||||
}
|
||||
|
||||
func updateSummaryView() {
|
||||
@@ -170,6 +170,19 @@ private extension MasterTimelineTableViewCell {
|
||||
setNeedsLayout()
|
||||
}
|
||||
}
|
||||
|
||||
func updateTextFieldAttributedText(_ label: UILabel, _ text: NSAttributedString?) {
|
||||
var s = text ?? NSAttributedString(string: "")
|
||||
|
||||
if let fieldFont = label.font, let color = label.textColor {
|
||||
s = s.adding(font: fieldFont, color: color)
|
||||
}
|
||||
|
||||
if label.attributedText != s {
|
||||
label.attributedText = s
|
||||
setNeedsLayout()
|
||||
}
|
||||
}
|
||||
|
||||
func updateFeedNameView() {
|
||||
switch cellData.showFeedName {
|
||||
|
||||
Reference in New Issue
Block a user