From a9342d10b7a4ff8227b3386ace31fd52fa49efe5 Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Wed, 10 Jun 2020 09:29:15 +0200 Subject: [PATCH] fix battery widget visibility in darkmode --- ModuleKit/Widgets/Battery.swift | 2 +- Modules/Battery/popup.swift | 2 +- Stats.xcodeproj/project.pbxproj | 4 ++-- StatsKit/extensions.swift | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ModuleKit/Widgets/Battery.swift b/ModuleKit/Widgets/Battery.swift index 3279b6d5f0d..2655a22f8be 100644 --- a/ModuleKit/Widgets/Battery.swift +++ b/ModuleKit/Widgets/Battery.swift @@ -97,7 +97,7 @@ public class BatterykWidget: Widget { if self.charging { NSColor.systemGreen.set() } else { - NSColor.black.set() + NSColor.textColor.set() } let bPX: CGFloat = x+w+1 diff --git a/Modules/Battery/popup.swift b/Modules/Battery/popup.swift index 456861d555b..e4dea368eed 100644 --- a/Modules/Battery/popup.swift +++ b/Modules/Battery/popup.swift @@ -187,7 +187,7 @@ private class BatteryView: NSView { let y: CGFloat = (dirtyRect.size.height - h) / 2 let radius: CGFloat = 3 let batteryFrame = NSBezierPath(roundedRect: NSRect(x: x+1, y: y, width: w, height: h), xRadius: radius, yRadius: radius) - NSColor.black.set() + NSColor.textColor.set() let bPX: CGFloat = x+w+1 let bPY: CGFloat = (dirtyRect.size.height / 2) - 4 diff --git a/Stats.xcodeproj/project.pbxproj b/Stats.xcodeproj/project.pbxproj index d2df5dd415d..6e5da970537 100644 --- a/Stats.xcodeproj/project.pbxproj +++ b/Stats.xcodeproj/project.pbxproj @@ -1515,7 +1515,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 2.0.3; + MARKETING_VERSION = 2.0.4; PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1547,7 +1547,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 2.0.3; + MARKETING_VERSION = 2.0.4; PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/StatsKit/extensions.swift b/StatsKit/extensions.swift index 99567cbc778..b4ae721e67b 100644 --- a/StatsKit/extensions.swift +++ b/StatsKit/extensions.swift @@ -208,15 +208,15 @@ public extension Double { switch self { case 0.2...0.4: if !color { - return NSColor.black + return NSColor.textColor } return NSColor.systemOrange case 0.4...1: if self == 1 { - return NSColor.black + return NSColor.textColor } if !color { - return NSColor.black + return NSColor.textColor } return NSColor.systemGreen default: