You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
715 B
22 lines
715 B
4 years ago
|
// Copyright © 2015 Abhishek Banthia
|
||
|
|
||
|
import Cocoa
|
||
|
|
||
3 years ago
|
class TimeMarkerViewItem: NSCollectionViewItem {
|
||
3 years ago
|
static let topConstraintIdentifier = "constrainFromTop"
|
||
4 years ago
|
static let reuseIdentifier = NSUserInterfaceItemIdentifier("HourMarkerViewItem")
|
||
3 years ago
|
@IBOutlet var verticalLineView: NSView!
|
||
3 years ago
|
|
||
3 years ago
|
func setup(with index: Int) {
|
||
3 years ago
|
for constraint in view.constraints where constraint.identifier == TimeMarkerViewItem.topConstraintIdentifier {
|
||
3 years ago
|
constraint.constant = index % 4 == 0 ? 0 : 20
|
||
3 years ago
|
}
|
||
3 years ago
|
verticalLineView.wantsLayer = true
|
||
|
verticalLineView.layer?.backgroundColor = NSColor.lightGray.cgColor
|
||
3 years ago
|
}
|
||
4 years ago
|
|
||
|
override var acceptsFirstResponder: Bool {
|
||
|
return false
|
||
|
}
|
||
|
}
|