mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
- add an option to select a color for each module (from a predefined list)
- add a separator to select color menu
This commit is contained in:
@@ -17,11 +17,19 @@
|
||||
<key>Value</key>
|
||||
<string>0.08</string>
|
||||
</dict>
|
||||
<key>Unsupported colors</key>
|
||||
<array>
|
||||
<string>pressure</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>line_chart</key>
|
||||
<dict>
|
||||
<key>Default</key>
|
||||
<false/>
|
||||
<key>Unsupported colors</key>
|
||||
<array>
|
||||
<string>pressure</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>bar_chart</key>
|
||||
<dict>
|
||||
@@ -34,6 +42,10 @@
|
||||
<key>Color</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>Unsupported colors</key>
|
||||
<array>
|
||||
<string>pressure</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
<key>Value</key>
|
||||
<string>0.36</string>
|
||||
</dict>
|
||||
<key>Unsupported colors</key>
|
||||
<array>
|
||||
<string>pressure</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>bar_chart</key>
|
||||
<dict>
|
||||
@@ -40,11 +44,13 @@
|
||||
<true/>
|
||||
<key>Box</key>
|
||||
<true/>
|
||||
<key>Color</key>
|
||||
<true/>
|
||||
<key>Value</key>
|
||||
<string>0.36</string>
|
||||
</dict>
|
||||
<key>Unsupported colors</key>
|
||||
<array>
|
||||
<string>pressure</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>disk</key>
|
||||
<dict>
|
||||
|
||||
@@ -27,7 +27,9 @@ internal class Popup: NSView {
|
||||
|
||||
internal func usageCallback(_ value: DiskList) {
|
||||
if self.list.count != value.list.count {
|
||||
self.subviews.forEach{ $0.removeFromSuperview() }
|
||||
DispatchQueue.main.async(execute: {
|
||||
self.subviews.forEach{ $0.removeFromSuperview() }
|
||||
})
|
||||
self.list = [:]
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ public class Memory: Module {
|
||||
self.popupView.loadCallback(value!)
|
||||
if let widget = self.widget as? Mini {
|
||||
widget.setValue(value!.usage ?? 0, sufix: "%")
|
||||
widget.setPressure(value?.pressureLevel ?? 0)
|
||||
}
|
||||
if let widget = self.widget as? LineChart {
|
||||
widget.setValue(value!.usage ?? 0)
|
||||
|
||||
Reference in New Issue
Block a user