Remove DB5 dependency from SidebarCellAppearance.

This commit is contained in:
Brent Simmons 2019-04-10 22:23:31 -07:00
parent e16085a949
commit 11945abd9d
2 changed files with 5 additions and 11 deletions

View File

@ -7,24 +7,18 @@
// //
import AppKit import AppKit
import DB5
struct SidebarCellAppearance: Equatable { struct SidebarCellAppearance: Equatable {
let imageSize: CGSize let imageSize = CGSize(width: 16, height: 16)
let imageMarginRight: CGFloat let imageMarginRight: CGFloat = 4.0
let unreadCountMarginLeft: CGFloat let unreadCountMarginLeft: CGFloat = 10.0
let textFieldFontSize: CGFloat let textFieldFontSize: CGFloat
let textFieldFont: NSFont let textFieldFont: NSFont
init(theme: VSTheme, fontSize: FontSize) { init(fontSize: FontSize) {
self.textFieldFontSize = AppDefaults.actualFontSize(for: fontSize) self.textFieldFontSize = AppDefaults.actualFontSize(for: fontSize)
self.textFieldFont = NSFont.systemFont(ofSize: textFieldFontSize) self.textFieldFont = NSFont.systemFont(ofSize: textFieldFontSize)
self.imageSize = theme.size(forKey: "MainWindow.SourceList.favicon.image")
self.imageMarginRight = theme.float(forKey: "MainWindow.SourceList.favicon.marginRight")
self.unreadCountMarginLeft = theme.float(forKey: "MainWindow.SourceList.unreadCount.marginLeft")
} }
} }

View File

@ -44,7 +44,7 @@ protocol SidebarDelegate: class {
override func viewDidLoad() { override func viewDidLoad() {
sidebarCellAppearance = SidebarCellAppearance(theme: appDelegate.currentTheme, fontSize: AppDefaults.sidebarFontSize) sidebarCellAppearance = SidebarCellAppearance(fontSize: AppDefaults.sidebarFontSize)
outlineView.dataSource = dataSource outlineView.dataSource = dataSource
outlineView.setDraggingSourceOperationMask(.move, forLocal: true) outlineView.setDraggingSourceOperationMask(.move, forLocal: true)