mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: renamed sensors widget to the stack widget
This commit is contained in:
@@ -32,7 +32,7 @@ public struct Stack_t: KeyValue_p {
|
||||
}
|
||||
}
|
||||
|
||||
public class SensorsWidget: WidgetWrapper {
|
||||
public class StackWidget: WidgetWrapper {
|
||||
private var modeState: StackMode = .auto
|
||||
private var fixedSizeState: Bool = false
|
||||
private var monospacedFontState: Bool = false
|
||||
@@ -57,7 +57,7 @@ public class SensorsWidget: WidgetWrapper {
|
||||
|
||||
self.orderTableView = OrderTableView(&self.values)
|
||||
|
||||
super.init(.sensors, title: title, frame: CGRect(
|
||||
super.init(.stack, title: title, frame: CGRect(
|
||||
x: 0,
|
||||
y: Constants.Widget.margin.y,
|
||||
width: Constants.Widget.width,
|
||||
@@ -21,7 +21,7 @@ public enum widget_t: String {
|
||||
case speed = "speed"
|
||||
case battery = "battery"
|
||||
case batteryDetails = "battery_details"
|
||||
case sensors = "sensors"
|
||||
case stack = "sensors" // to replace
|
||||
case memory = "memory"
|
||||
case label = "label"
|
||||
case tachometer = "tachometer"
|
||||
@@ -59,9 +59,9 @@ public enum widget_t: String {
|
||||
case .batteryDetails:
|
||||
preview = BatteryDetailsWidget(title: module, config: widgetConfig, preview: true)
|
||||
item = BatteryDetailsWidget(title: module, config: widgetConfig, preview: false)
|
||||
case .sensors:
|
||||
preview = SensorsWidget(title: module, config: widgetConfig, preview: true)
|
||||
item = SensorsWidget(title: module, config: widgetConfig, preview: false)
|
||||
case .stack:
|
||||
preview = StackWidget(title: module, config: widgetConfig, preview: true)
|
||||
item = StackWidget(title: module, config: widgetConfig, preview: false)
|
||||
case .memory:
|
||||
preview = MemoryWidget(title: module, config: widgetConfig, preview: true)
|
||||
item = MemoryWidget(title: module, config: widgetConfig, preview: false)
|
||||
@@ -93,7 +93,7 @@ public enum widget_t: String {
|
||||
} else if module == "CPU" {
|
||||
width = 30 + (Constants.Widget.margin.x*2)
|
||||
}
|
||||
case is SensorsWidget:
|
||||
case is StackWidget:
|
||||
if module == "Sensors" {
|
||||
width = 25
|
||||
} else if module == "Clock" {
|
||||
@@ -132,7 +132,7 @@ public enum widget_t: String {
|
||||
case .speed: return localizedString("Speed widget")
|
||||
case .battery: return localizedString("Battery widget")
|
||||
case .batteryDetails: return localizedString("Battery details widget")
|
||||
case .sensors: return localizedString("Text widget")
|
||||
case .stack: return localizedString("Stack widget")
|
||||
case .memory: return localizedString("Memory widget")
|
||||
case .label: return localizedString("Label widget")
|
||||
case .tachometer: return localizedString("Tachometer widget")
|
||||
|
||||
@@ -88,7 +88,7 @@ public class Bluetooth: Module {
|
||||
|
||||
self.menuBar.widgets.filter{ $0.isActive }.forEach { (w: Widget) in
|
||||
switch w.item {
|
||||
case let widget as SensorsWidget: widget.setValues(list)
|
||||
case let widget as StackWidget: widget.setValues(list)
|
||||
default: break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class Clock: Module {
|
||||
|
||||
self.menuBar.widgets.filter{ $0.isActive }.forEach { (w: Widget) in
|
||||
switch w.item {
|
||||
case let widget as SensorsWidget: widget.setValues(widgetList)
|
||||
case let widget as StackWidget: widget.setValues(widgetList)
|
||||
default: break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public class Sensors: Module {
|
||||
|
||||
self.menuBar.widgets.filter{ $0.isActive }.forEach { (w: Widget) in
|
||||
switch w.item {
|
||||
case let widget as SensorsWidget: widget.setValues(list)
|
||||
case let widget as StackWidget: widget.setValues(list)
|
||||
case let widget as BarChart: widget.setValue(flatList)
|
||||
default: break
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
9A2847652666AA2700EC1F6D /* Memory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A28475B2666AA2700EC1F6D /* Memory.swift */; };
|
||||
9A2847662666AA2700EC1F6D /* Speed.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A28475C2666AA2700EC1F6D /* Speed.swift */; };
|
||||
9A2847672666AA2700EC1F6D /* BarChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A28475D2666AA2700EC1F6D /* BarChart.swift */; };
|
||||
9A2847682666AA2700EC1F6D /* Sensors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A28475E2666AA2700EC1F6D /* Sensors.swift */; };
|
||||
9A2847682666AA2700EC1F6D /* Stack.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A28475E2666AA2700EC1F6D /* Stack.swift */; };
|
||||
9A2847792666AA5000EC1F6D /* module.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2847742666AA5000EC1F6D /* module.swift */; };
|
||||
9A28477A2666AA5000EC1F6D /* settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2847752666AA5000EC1F6D /* settings.swift */; };
|
||||
9A28477B2666AA5000EC1F6D /* popup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2847762666AA5000EC1F6D /* popup.swift */; };
|
||||
@@ -426,7 +426,7 @@
|
||||
9A28475B2666AA2700EC1F6D /* Memory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Memory.swift; sourceTree = "<group>"; };
|
||||
9A28475C2666AA2700EC1F6D /* Speed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Speed.swift; sourceTree = "<group>"; };
|
||||
9A28475D2666AA2700EC1F6D /* BarChart.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BarChart.swift; sourceTree = "<group>"; };
|
||||
9A28475E2666AA2700EC1F6D /* Sensors.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Sensors.swift; sourceTree = "<group>"; };
|
||||
9A28475E2666AA2700EC1F6D /* Stack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Stack.swift; sourceTree = "<group>"; };
|
||||
9A2847742666AA5000EC1F6D /* module.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = module.swift; sourceTree = "<group>"; };
|
||||
9A2847752666AA5000EC1F6D /* settings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = settings.swift; sourceTree = "<group>"; };
|
||||
9A2847762666AA5000EC1F6D /* popup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = popup.swift; sourceTree = "<group>"; };
|
||||
@@ -782,7 +782,7 @@
|
||||
9A2847562666AA2700EC1F6D /* NetworkChart.swift */,
|
||||
9A28475A2666AA2700EC1F6D /* Battery.swift */,
|
||||
9A28475B2666AA2700EC1F6D /* Memory.swift */,
|
||||
9A28475E2666AA2700EC1F6D /* Sensors.swift */,
|
||||
9A28475E2666AA2700EC1F6D /* Stack.swift */,
|
||||
9A28475C2666AA2700EC1F6D /* Speed.swift */,
|
||||
9A9B8C9C27149A3700218374 /* Tachometer.swift */,
|
||||
9AEBBE4C28D773430082A6A1 /* State.swift */,
|
||||
@@ -1750,7 +1750,7 @@
|
||||
5C23BC0429A014AC00DBA990 /* portal.swift in Sources */,
|
||||
9A2847792666AA5000EC1F6D /* module.swift in Sources */,
|
||||
9A2847662666AA2700EC1F6D /* Speed.swift in Sources */,
|
||||
9A2847682666AA2700EC1F6D /* Sensors.swift in Sources */,
|
||||
9A2847682666AA2700EC1F6D /* Stack.swift in Sources */,
|
||||
9AEBBE4D28D773430082A6A1 /* State.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
||||
Reference in New Issue
Block a user