mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: added Based on utilization color option for Bar chart widget in the Battery module (#865)
This commit is contained in:
@@ -171,7 +171,7 @@ public class BarChart: WidgetWrapper {
|
||||
if partitionValue.color == nil {
|
||||
switch self.colorState {
|
||||
case .systemAccent: controlAccentColor.set()
|
||||
case .utilization: partitionValue.value.usageColor(zones: self.colorZones).setFill()
|
||||
case .utilization: partitionValue.value.usageColor(zones: self.colorZones, reversed: self.title == "Battery").setFill()
|
||||
case .pressure: self.pressureLevel.pressureColor().setFill()
|
||||
case .monochrome:
|
||||
if self.boxState {
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
</dict>
|
||||
<key>Unsupported colors</key>
|
||||
<array>
|
||||
<string>utilization</string>
|
||||
<string>pressure</string>
|
||||
</array>
|
||||
<key>Order</key>
|
||||
|
||||
@@ -117,7 +117,9 @@ public class Battery: Module {
|
||||
case let widget as Mini:
|
||||
widget.setValue(abs(value.level))
|
||||
widget.setColorZones((0.15, 0.3))
|
||||
case let widget as BarChart: widget.setValue([[ColorValue(value.level)]])
|
||||
case let widget as BarChart:
|
||||
widget.setValue([[ColorValue(value.level)]])
|
||||
widget.setColorZones((0.15, 0.3))
|
||||
case let widget as BatterykWidget:
|
||||
widget.setValue(
|
||||
percentage: value.level ,
|
||||
|
||||
Reference in New Issue
Block a user