perf(menubar): 降低绘制驻留并复用原生进程表与缩略图
This commit is contained in:
@@ -88,10 +88,7 @@ struct CPUCoreGrid: View {
|
||||
return GeometryReader { proxy in
|
||||
let diameter = min(maximumDiameter, max(0, proxy.size.width - 4))
|
||||
ZStack {
|
||||
Circle().inset(by: 1).stroke(color(kind).opacity(0.16), lineWidth: 2)
|
||||
Circle().inset(by: 1).trim(from: 0, to: value)
|
||||
.stroke(color(kind), style: StrokeStyle(lineWidth: 2, lineCap: .round))
|
||||
.rotationEffect(.degrees(-90))
|
||||
NativeMetricRing(value: value, color: color(kind), lineWidth: 2, trackOpacity: 0.16, inset: 1)
|
||||
Text(verbatim: "\(Int((value * 100).rounded()))")
|
||||
.font(.system(size: 8, weight: .medium)).lineLimit(1).minimumScaleFactor(0.4)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user