fix(menubar): 修复清理构建状态项并增加液态外观选择
This commit is contained in:
@@ -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))")
|
||||
|
||||
Reference in New Issue
Block a user