@@ -96,13 +96,15 @@ final class DataGridCellFactory {
9696 let textField = reused. textField {
9797 cellView = reused
9898 cell = textField
99+ cell. font = DataGridFontCache . rowNumber
99100 } else {
100101 cellView = NSTableCellView ( )
101102 cellView. identifier = cellViewId
102103
103104 cell = NSTextField ( labelWithString: " " )
104105 cell. alignment = . right
105106 cell. font = DataGridFontCache . rowNumber
107+ cell. tag = DataGridFontVariant . rowNumber
106108 cell. textColor = . secondaryLabelColor
107109 cell. translatesAutoresizingMaskIntoConstraints = false
108110
@@ -312,35 +314,28 @@ final class DataGridCellFactory {
312314
313315 if value == nil {
314316 cell. stringValue = " "
317+ cell. font = DataGridFontCache . italic
318+ cell. tag = DataGridFontVariant . italic
315319 if !isLargeDataset {
316320 cell. placeholderString = nullDisplayString
317- cell. textColor = . secondaryLabelColor
318- if cell. font !== DataGridFontCache . italic {
319- cell. font = DataGridFontCache . italic
320- }
321- } else {
322- cell. textColor = . secondaryLabelColor
323321 }
322+ cell. textColor = . secondaryLabelColor
324323 } else if value == " __DEFAULT__ " {
325324 cell. stringValue = " "
325+ cell. font = DataGridFontCache . medium
326+ cell. tag = DataGridFontVariant . medium
326327 if !isLargeDataset {
327328 cell. placeholderString = " DEFAULT "
328- cell. textColor = . systemBlue
329- cell. font = DataGridFontCache . medium
330- } else {
331- cell. textColor = . systemBlue
332329 }
330+ cell. textColor = . systemBlue
333331 } else if value == " " {
334332 cell. stringValue = " "
333+ cell. font = DataGridFontCache . italic
334+ cell. tag = DataGridFontVariant . italic
335335 if !isLargeDataset {
336336 cell. placeholderString = " Empty "
337- cell. textColor = . secondaryLabelColor
338- if cell. font !== DataGridFontCache . italic {
339- cell. font = DataGridFontCache . italic
340- }
341- } else {
342- cell. textColor = . secondaryLabelColor
343337 }
338+ cell. textColor = . secondaryLabelColor
344339 } else {
345340 var displayValue = value ?? " "
346341
@@ -360,9 +355,8 @@ final class DataGridCellFactory {
360355 cell. stringValue = displayValue
361356 ( cell as? CellTextField ) ? . originalValue = value
362357 cell. textColor = . labelColor
363- if cell. font !== DataGridFontCache . regular {
364- cell. font = DataGridFontCache . regular
365- }
358+ cell. font = DataGridFontCache . regular
359+ cell. tag = DataGridFontVariant . regular
366360 }
367361 }
368362
0 commit comments