mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: changed monospacedSystemFont to the monospacedDigitSystemFont with the hope that this font does not cause the crash (#1395)
This commit is contained in:
@@ -138,7 +138,7 @@ public class SensorsWidget: WidgetWrapper {
|
||||
private func drawOneRow(_ x: CGFloat, _ element: Stack_t) -> CGFloat {
|
||||
var font: NSFont
|
||||
if #available(macOS 10.15, *), self.monospacedFontState {
|
||||
font = NSFont.monospacedSystemFont(ofSize: 13, weight: .regular)
|
||||
font = NSFont.monospacedDigitSystemFont(ofSize: 13, weight: .regular)
|
||||
} else {
|
||||
font = NSFont.systemFont(ofSize: 13, weight: .regular)
|
||||
}
|
||||
@@ -167,7 +167,7 @@ public class SensorsWidget: WidgetWrapper {
|
||||
|
||||
var font: NSFont
|
||||
if #available(macOS 10.15, *), self.monospacedFontState {
|
||||
font = NSFont.monospacedSystemFont(ofSize: 10, weight: .light)
|
||||
font = NSFont.monospacedDigitSystemFont(ofSize: 10, weight: .light)
|
||||
} else {
|
||||
font = NSFont.systemFont(ofSize: 10, weight: .light)
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ public struct DiskSize {
|
||||
}
|
||||
|
||||
public class LabelField: NSTextField {
|
||||
public init(frame: NSRect = NSRect(), _ label: String = "") {
|
||||
public init(frame: NSRect = NSRect.zero, _ label: String = "") {
|
||||
super.init(frame: frame)
|
||||
|
||||
self.isEditable = false
|
||||
@@ -252,7 +252,7 @@ public class LabelField: NSTextField {
|
||||
}
|
||||
|
||||
public class ValueField: NSTextField {
|
||||
public init(frame: NSRect, _ value: String = "") {
|
||||
public init(frame: NSRect = NSRect.zero, _ value: String = "") {
|
||||
super.init(frame: frame)
|
||||
|
||||
self.isEditable = false
|
||||
|
||||
Reference in New Issue
Block a user