1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-26 23:36:08 +03:00

Make folder bold

This commit is contained in:
Tae Won Ha 2019-02-26 19:18:15 +01:00
parent 27d4972c15
commit c57744c457
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
2 changed files with 16 additions and 1 deletions

View File

@ -213,6 +213,7 @@ extension ShortcutsPref {
}
cellView.text = item.title
cellView.isDir = !item.isLeaf
return cellView
}

View File

@ -20,8 +20,17 @@ class ShortcutTableRow: NSTableRowView {
class ShortcutTableCell: NSTableCellView {
static let font = NSFont.systemFont(ofSize: 13)
static let boldFont = NSFont.boldSystemFont(ofSize: 13)
var isDir = false
var isDir = false {
didSet {
if self.isDir {
self.textField?.font = ShortcutTableCell.boldFont
} else {
self.textField?.font = ShortcutTableCell.font
}
}
}
var attributedText: NSAttributedString {
get {
@ -40,6 +49,11 @@ class ShortcutTableCell: NSTableCellView {
}
set {
if self.isDir {
self.textField?.font = ShortcutTableCell.boldFont
} else {
self.textField?.font = ShortcutTableCell.font
}
self.textField?.stringValue = newValue
self.addTextField()
}