From 208ca77d743f4b04e30560bf207e115be7e2b345 Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Fri, 7 Apr 2023 16:37:14 +0200 Subject: [PATCH] fix: changed monospacedSystemFont to the monospacedDigitSystemFont with the hope that this font does not cause the crash (#1395) --- Kit/Widgets/Sensors.swift | 4 ++-- Kit/helpers.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Kit/Widgets/Sensors.swift b/Kit/Widgets/Sensors.swift index 3acd461b..bb459e29 100644 --- a/Kit/Widgets/Sensors.swift +++ b/Kit/Widgets/Sensors.swift @@ -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) } diff --git a/Kit/helpers.swift b/Kit/helpers.swift index dfa3eaa1..bffc3f0a 100644 --- a/Kit/helpers.swift +++ b/Kit/helpers.swift @@ -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