Create and use SidebarCellAppearance and SidebarCellLayout with SidebarCell.

This commit is contained in:
Brent Simmons
2017-11-24 21:39:59 -08:00
parent f8a05badcb
commit 4cf3f8dfe7
13 changed files with 218 additions and 132 deletions

View File

@@ -21,11 +21,14 @@ import RSCore
}()
var undoableCommands = [UndoableCommand]()
private var animatingChanges = false
private var sidebarCellAppearance: SidebarCellAppearance!
//MARK: NSViewController
override func viewDidLoad() {
sidebarCellAppearance = SidebarCellAppearance(theme: appDelegate.currentTheme, fontSize: AppDefaults.shared.sidebarFontSize)
outlineView.sidebarViewController = self
outlineView.setDraggingSourceOperationMask(.move, forLocal: true)
outlineView.setDraggingSourceOperationMask(.copy, forLocal: false)
@@ -317,10 +320,12 @@ private extension SidebarViewController {
func configure(_ cell: SidebarCell, _ node: Node) {
cell.cellAppearance = sidebarCellAppearance
cell.objectValue = node
cell.name = nameFor(node)
cell.unreadCount = unreadCountFor(node)
cell.image = imageFor(node)
cell.shouldShowImage = node.representedObject is Feed
}
func configureGroupCell(_ cell: NSTableCellView, _ node: Node) {
@@ -331,6 +336,9 @@ private extension SidebarViewController {
func imageFor(_ node: Node) -> NSImage? {
// if let feed = node.representedObject as? Feed {
//
// }
return nil
}