Make drawing the grid in the timeline a DB5 option.
This commit is contained in:
parent
24db26777f
commit
994426ffa1
@ -34,6 +34,7 @@ struct TimelineCellAppearance: Equatable {
|
|||||||
let starDimension: CGFloat
|
let starDimension: CGFloat
|
||||||
|
|
||||||
let gridColor: NSColor
|
let gridColor: NSColor
|
||||||
|
let drawsGrid: Bool
|
||||||
|
|
||||||
let avatarSize: NSSize
|
let avatarSize: NSSize
|
||||||
let avatarMarginRight: CGFloat
|
let avatarMarginRight: CGFloat
|
||||||
@ -71,7 +72,8 @@ struct TimelineCellAppearance: Equatable {
|
|||||||
self.starDimension = theme.float(forKey: "MainWindow.Timeline.cell.starDimension")
|
self.starDimension = theme.float(forKey: "MainWindow.Timeline.cell.starDimension")
|
||||||
|
|
||||||
self.gridColor = theme.colorWithAlpha(forKey: "MainWindow.Timeline.gridColor")
|
self.gridColor = theme.colorWithAlpha(forKey: "MainWindow.Timeline.gridColor")
|
||||||
|
self.drawsGrid = theme.bool(forKey: "MainWindow.Timeline.drawsGrid")
|
||||||
|
|
||||||
self.avatarSize = theme.size(forKey: "MainWindow.Timeline.cell.avatar")
|
self.avatarSize = theme.size(forKey: "MainWindow.Timeline.cell.avatar")
|
||||||
self.avatarMarginRight = theme.float(forKey: "MainWindow.Timeline.cell.avatarMarginRight")
|
self.avatarMarginRight = theme.float(forKey: "MainWindow.Timeline.cell.avatarMarginRight")
|
||||||
self.avatarAdjustmentTop = theme.float(forKey: "MainWindow.Timeline.cell.avatarAdjustmentTop")
|
self.avatarAdjustmentTop = theme.float(forKey: "MainWindow.Timeline.cell.avatarAdjustmentTop")
|
||||||
|
@ -17,11 +17,11 @@ class TimelineTableRowView : NSTableRowView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// override var interiorBackgroundStyle: NSBackgroundStyle {
|
// override var interiorBackgroundStyle: NSBackgroundStyle {
|
||||||
// return .Light
|
// return .Light
|
||||||
// }
|
// }
|
||||||
|
|
||||||
private var cellView: TimelineTableCellView? {
|
private var cellView: TimelineTableCellView? {
|
||||||
for oneSubview in subviews {
|
for oneSubview in subviews {
|
||||||
if let foundView = oneSubview as? TimelineTableCellView {
|
if let foundView = oneSubview as? TimelineTableCellView {
|
||||||
@ -50,7 +50,7 @@ class TimelineTableRowView : NSTableRowView {
|
|||||||
var gridRect: NSRect {
|
var gridRect: NSRect {
|
||||||
return NSMakeRect(0.0, NSMaxY(bounds) - 1.0, NSWidth(bounds), 1)
|
return NSMakeRect(0.0, NSMaxY(bounds) - 1.0, NSWidth(bounds), 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func drawSeparator(in dirtyRect: NSRect) {
|
override func drawSeparator(in dirtyRect: NSRect) {
|
||||||
|
|
||||||
let path = NSBezierPath()
|
let path = NSBezierPath()
|
||||||
@ -68,7 +68,7 @@ class TimelineTableRowView : NSTableRowView {
|
|||||||
|
|
||||||
super.draw(dirtyRect)
|
super.draw(dirtyRect)
|
||||||
|
|
||||||
if !isSelected && !isNextRowSelected {
|
if cellAppearance.drawsGrid && !isSelected && !isNextRowSelected {
|
||||||
drawSeparator(in: dirtyRect)
|
drawSeparator(in: dirtyRect)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,8 @@
|
|||||||
<string>000000</string>
|
<string>000000</string>
|
||||||
<key>gridColorAlpha</key>
|
<key>gridColorAlpha</key>
|
||||||
<real>0.1</real>
|
<real>0.1</real>
|
||||||
|
<key>drawsGrid</key>
|
||||||
|
<false/>
|
||||||
<key>header</key>
|
<key>header</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>backgroundColor</key>
|
<key>backgroundColor</key>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user