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.

37 lines
1.0 KiB

4 years ago
// Copyright © 2015 Abhishek Banthia
import Cocoa
class HourMarkerViewItem: NSCollectionViewItem {
4 years ago
static let reuseIdentifier = NSUserInterfaceItemIdentifier("HourMarkerViewItem")
3 years ago
@IBOutlet var verticalLineView: NSView!
func setup(with index: Int) {
for constraint in view.constraints where constraint.identifier == "constrainFromTop" {
if index % 4 == 0 {
constraint.constant = 0
} else {
constraint.constant = 20
}
}
3 years ago
verticalLineView.wantsLayer = true
verticalLineView.layer?.backgroundColor = NSColor.lightGray.cgColor
}
4 years ago
func setupLineColor() {
for subview in view.subviews where subview is NSBox {
subview.layer?.backgroundColor = NSColor.black.cgColor
}
}
4 years ago
func resetLineColor() {
for subview in view.subviews where subview is NSBox {
subview.layer?.backgroundColor = nil
4 years ago
}
}
4 years ago
override var acceptsFirstResponder: Bool {
return false
}
}