Repository navigation
Expand file tree
/
Copy pathNoteRowView.swift
More file actions
52 lines (41 loc) · 1.53 KB
/
Copy pathNoteRowView.swift
File metadata and controls
52 lines (41 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// NoteRowView.swift
// FSNotes
//
// Created by Oleksandr Glushchenko on 7/31/17.
// Copyright © 2017 Oleksandr Glushchenko. All rights reserved.
//
import Cocoa
class NoteRowView: NSTableRowView {
override func draw(_ dirtyRect: NSRect) {
super.draw(dirtyRect)
}
override func drawSelection(in dirtyRect: NSRect) {
guard UserDefaults.standard.value(forKey: "AppleAccentColor") == nil else {
super.drawSelection(in: dirtyRect)
return
}
if self.selectionHighlightStyle != .none {
let selectionRect = NSInsetRect(self.bounds, 0, 0)
if isSelected {
if window?.firstResponder == superview {
if let color = NSColor.init(named: "background_selected_fr") {
color.setStroke()
color.setFill()
}
let selectionPath = NSBezierPath.init(roundedRect: selectionRect, xRadius: 2, yRadius: 2)
selectionPath.fill()
selectionPath.stroke()
} else {
if let color = NSColor.init(named: "background_selected_not_fr") {
color.setStroke()
color.setFill()
}
let selectionPath = NSBezierPath.init(roundedRect: selectionRect, xRadius: 2, yRadius: 2)
selectionPath.fill()
selectionPath.stroke()
}
}
}
}
}