fix: changed monospacedSystemFont to the monospacedDigitSystemFont with the hope that this font does not cause the crash (#1395)

This commit is contained in:
Serhiy Mytrovtsiy
2023-04-07 16:37:14 +02:00
parent a1758c3233
commit 208ca77d74
2 changed files with 4 additions and 4 deletions

View File

@@ -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)
}

View File

@@ -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