refactor(menubar): 精简内存卡片并对齐双列底部

This commit is contained in:
2026-11-09 00:05:25 +08:00
parent 28112bcf2e
commit 1afe82b233
15 changed files with 119 additions and 40 deletions
@@ -79,12 +79,14 @@ extension MenuPanelView {
}
var memoryCard: some View {
ResourceCard(
let header = MemoryHeaderInfo(memory: snapshot.memory, locale: locale)
return ResourceCard(
title: "metric.memory", symbol: "memorychip", color: Color("MemoryApplication"),
value: snapshot.memory.map {
String(format: "%.1f / %.0f GiB", Double($0.used) / 1_073_741_824, Double($0.total) / 1_073_741_824)
} ?? "--",
status: snapshot.memory.map { MetricFormat.percent($0.usage) }
status: snapshot.memory.map { MetricFormat.percent($0.usage) },
detail: header.title, detailColor: header.color, detailHelp: header.help
) {
PanelTrendChart(
dates: samples.map(\.date),