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 -3
View File
@@ -2,9 +2,12 @@ import Foundation
import CoreGraphics
nonisolated enum PanelLayout {
static func resourceRowHeight(size: CGSize) -> CGFloat { min(230, max(220, size.height - 590)) }
static func batteryWidth(size: CGSize) -> CGFloat { resourceRowHeight(size: size) * 4 / 3 }
static func firstRowWideCardWidth(size: CGSize) -> CGFloat { (size.width - 36 - batteryWidth(size: size)) / 2 }
static func resourceRowHeight(size: CGSize, coreRows: Int) -> CGFloat {
let compact = min(239, max(224, size.height - 581))
let thirdRowExpansion: CGFloat = coreRows >= 3 ? 26 : 0
return min(265, compact + thirdRowExpansion)
}
static func cardWidth(size: CGSize) -> CGFloat { max(0, (size.width - 36) / 3) }
static func contentSize(visible: CGRect, chrome: CGSize = .zero) -> CGSize {
CGSize(width: max(1, min(1240, visible.width - 32 - max(0, chrome.width))),