NetNewsWire/Evergreen/MainWindow/Timeline/Cell/TimelineCellAppearance.swift

72 lines
2.3 KiB
Swift
Raw Normal View History

2017-05-27 19:43:27 +02:00
//
// TimelineCellAppearance.swift
// Evergreen
//
// Created by Brent Simmons on 2/6/16.
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
//
import Cocoa
import DB5
struct TimelineCellAppearance {
2017-09-17 21:34:10 +02:00
let cellPadding: NSEdgeInsets
2017-05-27 19:43:27 +02:00
let feedNameColor: NSColor
let feedNameFont: NSFont
let faviconFeedNameSpacing: CGFloat
let faviconSize = NSSize(width: 16, height: 16)
let dateColor: NSColor
let dateMarginLeft: CGFloat
let dateFont: NSFont
let titleColor: NSColor
let titleFont: NSFont
let titleBottomMargin: CGFloat
let textColor: NSColor
let textFont: NSFont
let unreadCircleColor: NSColor
let unreadCircleDimension: CGFloat
let unreadCircleMarginRight: CGFloat
let boxLeftMargin: CGFloat
let gridColor: NSColor
init(theme: VSTheme, fontSize: FontSize) {
let actualFontSize = AppDefaults.actualFontSize(for: fontSize)
2017-05-27 19:43:27 +02:00
cellPadding = theme.edgeInsets(forKey: "MainWindow.Timeline.cell.padding")
feedNameColor = theme.color(forKey: "MainWindow.Timeline.cell.feedNameColor")
feedNameFont = NSFont.systemFont(ofSize: actualFontSize)
faviconFeedNameSpacing = theme.float(forKey: "MainWindow.Timeline.cell.faviconFeedNameSpacing")
dateColor = theme.color(forKey: "MainWindow.Timeline.cell.dateColor")
let actualDateFontSize = AppDefaults.actualFontSize(for: fontSize)
2017-05-27 19:43:27 +02:00
dateFont = NSFont.systemFont(ofSize: actualDateFontSize)
dateMarginLeft = theme.float(forKey: "MainWindow.Timeline.cell.dateMarginLeft")
titleColor = theme.color(forKey: "MainWindow.Timeline.cell.titleColor")
2017-09-24 21:24:44 +02:00
titleFont = NSFont.systemFont(ofSize: actualFontSize, weight: NSFont.Weight.bold)
2017-05-27 19:43:27 +02:00
titleBottomMargin = theme.float(forKey: "MainWindow.Timeline.cell.titleMarginBottom")
textColor = theme.color(forKey: "MainWindow.Timeline.cell.textColor")
textFont = NSFont.systemFont(ofSize: actualFontSize)
unreadCircleColor = theme.color(forKey: "MainWindow.Timeline.cell.unreadCircleColor")
unreadCircleDimension = theme.float(forKey: "MainWindow.Timeline.cell.unreadCircleDimension")
unreadCircleMarginRight = theme.float(forKey: "MainWindow.Timeline.cell.unreadCircleMarginRight")
boxLeftMargin = cellPadding.left + unreadCircleDimension + unreadCircleMarginRight
gridColor = theme.colorWithAlpha(forKey: "MainWindow.Timeline.gridColor")
}
}