From 3d5be1022c22341bd610e1a35d5b3bf770028b33 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 18 Feb 2018 16:13:58 -0800 Subject: [PATCH] Define a textOnlyColor for when an article has no title. --- .../Timeline/Cell/TimelineCellAppearance.swift | 11 +++++++++-- .../MainWindow/Timeline/Cell/TimelineCellData.swift | 4 ++-- Evergreen/Resources/DB5.plist | 10 +++++++--- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Evergreen/MainWindow/Timeline/Cell/TimelineCellAppearance.swift b/Evergreen/MainWindow/Timeline/Cell/TimelineCellAppearance.swift index 71c8719d3..048313692 100644 --- a/Evergreen/MainWindow/Timeline/Cell/TimelineCellAppearance.swift +++ b/Evergreen/MainWindow/Timeline/Cell/TimelineCellAppearance.swift @@ -26,7 +26,10 @@ struct TimelineCellAppearance: Equatable { let textColor: NSColor let textFont: NSFont - + + let textOnlyColor: NSColor + let textOnlyFont: NSFont + let unreadCircleColor: NSColor let unreadCircleDimension: CGFloat let unreadCircleMarginRight: CGFloat @@ -60,11 +63,15 @@ struct TimelineCellAppearance: Equatable { self.dateMarginLeft = theme.float(forKey: "MainWindow.Timeline.cell.dateMarginLeft") self.titleColor = theme.color(forKey: "MainWindow.Timeline.cell.titleColor") - self.titleFont = NSFont.systemFont(ofSize: actualFontSize, weight: NSFont.Weight.bold) + let titleFontSizeMultiplier = theme.float(forKey: "MainWindow.Timeline.cell.titleFontSizeMultiplier") + self.titleFont = NSFont.systemFont(ofSize: floor(actualFontSize * titleFontSizeMultiplier), weight: NSFont.Weight.semibold) self.titleBottomMargin = theme.float(forKey: "MainWindow.Timeline.cell.titleMarginBottom") self.textColor = theme.color(forKey: "MainWindow.Timeline.cell.textColor") self.textFont = NSFont.systemFont(ofSize: actualFontSize) + + self.textOnlyColor = theme.color(forKey: "MainWindow.Timeline.cell.textOnlyColor") + self.textOnlyFont = self.textFont self.unreadCircleColor = theme.color(forKey: "MainWindow.Timeline.cell.unreadCircleColor") self.unreadCircleDimension = theme.float(forKey: "MainWindow.Timeline.cell.unreadCircleDimension") diff --git a/Evergreen/MainWindow/Timeline/Cell/TimelineCellData.swift b/Evergreen/MainWindow/Timeline/Cell/TimelineCellData.swift index f7e6ff5e2..95dd388e2 100644 --- a/Evergreen/MainWindow/Timeline/Cell/TimelineCellData.swift +++ b/Evergreen/MainWindow/Timeline/Cell/TimelineCellData.swift @@ -30,7 +30,7 @@ struct TimelineCellData { let starred: Bool init(article: Article, appearance: TimelineCellAppearance, showFeedName: Bool, feedName: String?, avatar: NSImage?, showAvatar: Bool, featuredImage: NSImage?) { - + self.title = timelineTruncatedTitle(article) self.text = timelineTruncatedSummary(article) @@ -117,6 +117,6 @@ private func attributedTitleString(_ title: String, _ text: String, _ appearance return NSAttributedString(string: title, attributes: [NSAttributedStringKey.foregroundColor: appearance.titleColor, NSAttributedStringKey.font: appearance.titleFont]) } - return NSAttributedString(string: text, attributes: [NSAttributedStringKey.foregroundColor: appearance.textColor, NSAttributedStringKey.font: appearance.textFont]) + return NSAttributedString(string: text, attributes: [NSAttributedStringKey.foregroundColor: appearance.textOnlyColor, NSAttributedStringKey.font: appearance.textFont]) } diff --git a/Evergreen/Resources/DB5.plist b/Evergreen/Resources/DB5.plist index 227278ee5..b61d63f4d 100644 --- a/Evergreen/Resources/DB5.plist +++ b/Evergreen/Resources/DB5.plist @@ -78,13 +78,13 @@ paddingLeft 20 paddingRight - 12 + 20 paddingTop 14 paddingBottom 16 feedNameColor - 999999 + aaaaaa faviconFeedNameSpacing 2 dateColor @@ -94,9 +94,13 @@ dateMarginBottom 2 textColor - 666666 + 999999 + textOnlyColor + 222222 titleColor 222222 + titleFontSizeMultiplier + 1.1 titleMarginBottom 1 unreadCircleColor