diff --git a/SensorsUI.xcodeproj/project.pbxproj b/SensorsUI.xcodeproj/project.pbxproj index 8929725..66599fa 100644 --- a/SensorsUI.xcodeproj/project.pbxproj +++ b/SensorsUI.xcodeproj/project.pbxproj @@ -24,6 +24,7 @@ 058B8EBE2994387900263FE9 /* SensorsKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 058B8E96299436D900263FE9 /* SensorsKit.framework */; }; 058B8EBF2994387900263FE9 /* SensorsKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 058B8E96299436D900263FE9 /* SensorsKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 05BDE9EE29944B9D00B0B888 /* AmbiantLightTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 05BDE9EC29944B9D00B0B888 /* AmbiantLightTemplate.pdf */; }; + 38B72A892C53DAE100AD0B87 /* FanTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 38B72A882C53DAE100AD0B87 /* FanTemplate.pdf */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -115,6 +116,7 @@ 05BDE9EC29944B9D00B0B888 /* AmbiantLightTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = AmbiantLightTemplate.pdf; sourceTree = ""; }; 05E0C31B268635C300D1D216 /* SensorItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SensorItem.swift; sourceTree = ""; }; 05E0C31E268635F200D1D216 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/SensorItem.xib; sourceTree = ""; }; + 38B72A882C53DAE100AD0B87 /* FanTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = FanTemplate.pdf; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -274,6 +276,7 @@ 0566B9402686438E006EE45A /* CurrentTemplate.pdf */, 0566B9412686438E006EE45A /* ThermalTemplate.pdf */, 0566B93F2686438E006EE45A /* VoltageTemplate.pdf */, + 38B72A882C53DAE100AD0B87 /* FanTemplate.pdf */, ); path = Images; sourceTree = ""; @@ -397,6 +400,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 38B72A892C53DAE100AD0B87 /* FanTemplate.pdf in Resources */, 058B8EBC2994386E00263FE9 /* ThermalTemplate.pdf in Resources */, 058B8EBA2994386B00263FE9 /* SensorItem.xib in Resources */, 058B8EBD2994386E00263FE9 /* VoltageTemplate.pdf in Resources */, diff --git a/SensorsUI/Base.lproj/SensorsWindowController.xib b/SensorsUI/Base.lproj/SensorsWindowController.xib index 653274d..38bc56f 100644 --- a/SensorsUI/Base.lproj/SensorsWindowController.xib +++ b/SensorsUI/Base.lproj/SensorsWindowController.xib @@ -1,8 +1,8 @@ - + - + @@ -19,7 +19,7 @@ - + @@ -84,7 +84,7 @@ + + + @@ -208,7 +220,6 @@ - @@ -217,6 +228,7 @@ + diff --git a/SensorsUI/Colors.swift b/SensorsUI/Colors.swift index c66c3f9..c17cc54 100644 --- a/SensorsUI/Colors.swift +++ b/SensorsUI/Colors.swift @@ -32,6 +32,7 @@ public class Colors switch kind { case .thermal: return NSColor.systemOrange + case .rpm: return NSColor.systemBlue case .voltage: return NSColor.systemPurple case .current: return NSColor.systemTeal case .ambiantLight: return NSColor.systemYellow diff --git a/SensorsUI/Images/FanTemplate.pdf b/SensorsUI/Images/FanTemplate.pdf new file mode 100644 index 0000000..574fed8 Binary files /dev/null and b/SensorsUI/Images/FanTemplate.pdf differ diff --git a/SensorsUI/SensorIcon.swift b/SensorsUI/SensorIcon.swift index 7a71f9c..64d5a6d 100644 --- a/SensorsUI/SensorIcon.swift +++ b/SensorsUI/SensorIcon.swift @@ -49,6 +49,7 @@ public class SensorIcon: ValueTransformer switch data.kind { case .thermal: return self.image( named: "ThermalTemplate" )?.tinted( with: Colors.color( for: data.kind ) ) + case .rpm: return self.image( named: "FanTemplate" )?.tinted(with: Colors.color(for: data.kind ) ) case .voltage: return self.image( named: "VoltageTemplate" )?.tinted( with: Colors.color( for: data.kind ) ) case .current: return self.image( named: "CurrentTemplate" )?.tinted( with: Colors.color( for: data.kind ) ) case .ambiantLight: return self.image( named: "AmbiantLightTemplate" )?.tinted( with: Colors.color( for: data.kind ) ) diff --git a/SensorsUI/SensorsWindowController.swift b/SensorsUI/SensorsWindowController.swift index 1f82366..9bb9566 100644 --- a/SensorsUI/SensorsWindowController.swift +++ b/SensorsUI/SensorsWindowController.swift @@ -65,6 +65,15 @@ public class SensorsWindowController: NSWindowController } } + @objc private dynamic var showFanSpeed = UserDefaults.standard.object( forKey: "sensorsWindowShowFanSpeed" ) as? Bool ?? true + { + didSet + { + self.updateFilters() + UserDefaults.standard.set( self.showFanSpeed, forKey: "sensorsWindowShowFanSpeed" ) + } + } + @objc private dynamic var showIOHID = UserDefaults.standard.object( forKey: "sensorsWindowShowIOHID" ) as? Bool ?? true { didSet @@ -151,6 +160,11 @@ public class SensorsWindowController: NSWindowController predicates.append( NSPredicate { o, i in ( o as? SensorHistoryData )?.kind != .ambiantLight } ) } + if self.showFanSpeed == false + { + predicates.append( NSPredicate { o, i in ( o as? SensorHistoryData )?.kind != .rpm } ) + } + if self.showIOHID == false { predicates.append( NSPredicate { o, i in ( o as? SensorHistoryData )?.source != .hid } )