//
// Created by Matt Baer on 8/3/17.
// Copyright (c) 2017 A Bunch Tell. All rights reserved.
//

import Foundation
import AppKit

class TextField: NSTextView {
    override func becomeFirstResponder() -> Bool {
        let success = super.becomeFirstResponder()
        if success {
            // #5ac4ee
            self.insertionPointColor = NSColor(red:0.35, green:0.77, blue:0.93, alpha:1.0)
        }

        return success
    }

    override func drawInsertionPoint(in rect: NSRect, color: NSColor, turnedOn flag: Bool) {
        /*
        if flag {
            var rect = rect
            var color = self.insertionPointColor
            rect.size.width = 2
            let path = NSBezierPath(rect: rect)
            path.setClip()
            path.fill()
        }
        */
        super.drawInsertionPoint(in: rect, color: color, turnedOn: flag)
    }
}
