Define a textOnlyColor for when an article has no title.

This commit is contained in:
Brent Simmons 2018-02-18 16:13:58 -08:00
parent 0ad41358fc
commit 3d5be1022c
3 changed files with 18 additions and 7 deletions

View File

@ -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")

View File

@ -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])
}

View File

@ -78,13 +78,13 @@
<key>paddingLeft</key>
<integer>20</integer>
<key>paddingRight</key>
<integer>12</integer>
<integer>20</integer>
<key>paddingTop</key>
<integer>14</integer>
<key>paddingBottom</key>
<integer>16</integer>
<key>feedNameColor</key>
<string>999999</string>
<string>aaaaaa</string>
<key>faviconFeedNameSpacing</key>
<integer>2</integer>
<key>dateColor</key>
@ -94,9 +94,13 @@
<key>dateMarginBottom</key>
<integer>2</integer>
<key>textColor</key>
<string>666666</string>
<string>999999</string>
<key>textOnlyColor</key>
<string>222222</string>
<key>titleColor</key>
<string>222222</string>
<key>titleFontSizeMultiplier</key>
<real>1.1</real>
<key>titleMarginBottom</key>
<integer>1</integer>
<key>unreadCircleColor</key>