Browse Source

Update HourMarkerViewItem.swift

pull/101/head
Abhishek 3 years ago
parent
commit
bc89f1e66e
  1. 9
      Clocker/Panel/UI/HourMarkerViewItem.swift

9
Clocker/Panel/UI/HourMarkerViewItem.swift

@ -3,16 +3,13 @@
import Cocoa import Cocoa
class HourMarkerViewItem: NSCollectionViewItem { class HourMarkerViewItem: NSCollectionViewItem {
static let topConstraintIdentifier = "constrainFromTop"
static let reuseIdentifier = NSUserInterfaceItemIdentifier("HourMarkerViewItem") static let reuseIdentifier = NSUserInterfaceItemIdentifier("HourMarkerViewItem")
@IBOutlet var verticalLineView: NSView! @IBOutlet var verticalLineView: NSView!
func setup(with index: Int) { func setup(with index: Int) {
for constraint in view.constraints where constraint.identifier == "constrainFromTop" { for constraint in view.constraints where constraint.identifier == HourMarkerViewItem.topConstraintIdentifier {
if index % 4 == 0 { constraint.constant = index % 4 == 0 ? 0 : 20
constraint.constant = 0
} else {
constraint.constant = 20
}
} }
verticalLineView.wantsLayer = true verticalLineView.wantsLayer = true
verticalLineView.layer?.backgroundColor = NSColor.lightGray.cgColor verticalLineView.layer?.backgroundColor = NSColor.lightGray.cgColor

Loading…
Cancel
Save