mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: change value type from Double to ColorValue in the BarChart (#441)
This commit is contained in:
@@ -128,7 +128,12 @@ public class CPU: Module {
|
||||
switch w.item {
|
||||
case let widget as Mini: widget.setValue(value.totalUsage)
|
||||
case let widget as LineChart: widget.setValue(value.totalUsage)
|
||||
case let widget as BarChart: widget.setValue(self.usagePerCoreState ? value.usagePerCore : [value.totalUsage])
|
||||
case let widget as BarChart:
|
||||
var val: [[ColorValue]] = [[ColorValue(value.totalUsage)]]
|
||||
if self.usagePerCoreState {
|
||||
val = value.usagePerCore.map({ [ColorValue($0)] })
|
||||
}
|
||||
widget.setValue(val)
|
||||
case let widget as PieChart:
|
||||
widget.setValue([
|
||||
circle_segment(value: value.systemLoad, color: NSColor.systemRed),
|
||||
|
||||
Reference in New Issue
Block a user