feat(panel): 调整资源卡片读数布局并保留趋势平移

逐核显示 CPU 占用,在 GPU 标题展示核数并补充分项读数。无电池设备显示整机功率。

存储与网络将曲线排在详情下方,CPU、GPU、内存和电池保留整卡趋势。数值直接刷新,曲线随采样平滑平移。顶栏展示版本号,底栏调整开机时间和刷新间隔。
This commit is contained in:
2026-11-15 22:03:46 +08:00
parent c886c4227d
commit 6300db3d15
27 changed files with 427 additions and 250 deletions
+3 -3
View File
@@ -25,12 +25,12 @@ nonisolated enum PanelLayout {
}
}
/// Structural foreground height determines the full-height background chart.
/// Structural foreground height determines the room available for the trend below the text.
static func cardHeights(coreRows: Int, fanCount: Int?) -> [PanelCard: CGFloat] {
let base = ResourceCardMetrics.minimumHeight
let fanRows = fanCount.map { (max(0, $0) + 1) / 2 } ?? 1
return [.cpu: base + CGFloat(max(0, coreRows - 1)) * 34,
.gpu: base + CGFloat(max(0, fanRows - 1)) * 14,
return [.cpu: base + CGFloat(max(0, coreRows - 1)) * 15,
.gpu: base + CGFloat(max(0, fanRows - 1)) * 18,
.memory: base, .battery: base, .storage: base, .network: base]
}