From 8c9f0dfd19c74d50e2e66e41035869e5e07e7756 Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Wed, 23 Sep 2020 21:07:09 +0200 Subject: [PATCH] - update the visibility of sensors value in the widget when one value in row (#90) --- ModuleKit/Widgets/Sensors.swift | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/ModuleKit/Widgets/Sensors.swift b/ModuleKit/Widgets/Sensors.swift index 54b812e8..828b68cb 100644 --- a/ModuleKit/Widgets/Sensors.swift +++ b/ModuleKit/Widgets/Sensors.swift @@ -58,6 +58,7 @@ public class SensorsWidget: Widget { public override func draw(_ dirtyRect: NSRect) { super.draw(dirtyRect) + guard self.values.count != 0 else { self.setWidth(1) return @@ -79,15 +80,27 @@ public class SensorsWidget: Widget { var x: CGFloat = Constants.Widget.margin for i in 0..