perf(menubar): 减少进程表刷新排序并清理闲置代码

This commit is contained in:
2026-11-16 00:06:14 +08:00
parent 97c1bc3b7f
commit 3ee6b45eb4
7 changed files with 43 additions and 73 deletions
@@ -1,23 +0,0 @@
import SwiftUI
/// Clips both layers to the track, including fills narrower than the track height.
struct MetricProgressBar: View {
let value: Double
let color: Color
var cornerRadius: CGFloat? = nil
private var fraction: Double { value.isFinite ? min(1, max(0, value)) : 0 }
var body: some View {
GeometryReader { proxy in
let shape = RoundedRectangle(cornerRadius: cornerRadius ?? proxy.size.height / 2, style: .continuous)
ZStack(alignment: .leading) {
shape.fill(color.opacity(0.15))
shape.fill(color).frame(width: proxy.size.width * fraction)
}
.frame(width: proxy.size.width, height: proxy.size.height)
.clipShape(shape)
.transaction { $0.animation = nil; $0.disablesAnimations = true }
}
}
}