fix(menubar): 修复清理构建状态项并增加液态外观选择

This commit is contained in:
2026-10-30 17:24:39 +08:00
parent 5b71e5bd80
commit c411a8241f
12 changed files with 122 additions and 48 deletions
+2 -22
View File
@@ -1,25 +1,5 @@
import SwiftUI
struct MenuBarLabel: View {
let snapshot: MetricsSnapshot
var body: some View {
// Use one native image/title label: the previous multi-view HStack showed
// only its first image and percentage in the user-verified menu bar.
Label {
Text(verbatim: title)
.monospacedDigit()
} icon: {
Image("BrandMark")
.renderingMode(.template)
.resizable()
.scaledToFit()
.frame(width: 18, height: 18)
}
.labelStyle(.titleAndIcon)
}
private var title: String {
enum MenuBarLabel {
static func title(for snapshot: MetricsSnapshot) -> String {
var items = ["CPU \(MetricFormat.percent(snapshot.cpu?.usage))"]
if let gpu = snapshot.gpuUsage {
items.append("GPU \(MetricFormat.percent(gpu))")