feat(menubar): 完善首排监控卡片与温度风扇采样

补充 GPU 渲染分块、内存与利用率统计,增加只读 SMC 温度及风扇信息和旋转动效。完善电池功率与耗电进程列表,统一首排布局并固定异步加载区域高度。同步验证用例、架构说明和 GPU 能力调研工具。
This commit is contained in:
2026-11-03 16:42:09 +08:00
parent 45a6e16bb8
commit cc38066de2
43 changed files with 2658 additions and 536 deletions
+6 -5
View File
@@ -14,11 +14,12 @@ import CoreGraphics
}
}
for size in [CGSize(width: 1240, height: 820), CGSize(width: 1160, height: 810)] {
let square = PanelLayout.resourceRowHeight(size: size)
let wide = PanelLayout.firstRowWideCardWidth(size: size)
precondition(square >= 220 && square <= 230)
precondition(abs(PanelLayout.batteryWidth(size: size) / square - 4.0 / 3.0) < 0.001)
precondition(abs(2 * wide + PanelLayout.batteryWidth(size: size) + 16 - (size.width - 20)) < 0.001)
let compact = PanelLayout.resourceRowHeight(size: size, coreRows: 2)
let expanded = PanelLayout.resourceRowHeight(size: size, coreRows: 3)
let width = PanelLayout.cardWidth(size: size)
precondition(compact >= 224 && compact <= 239)
precondition(expanded == min(265, compact + 26))
precondition(abs(3 * width + 16 - (size.width - 20)) < 0.001)
}
let input: [ProcessMetrics] = (0..<2000).map { (index: Int) -> ProcessMetrics in
let id = ProcessIdentity(pid: Int32(index + 1), seconds: 1, microseconds: 0)