perf(menubar): 降低绘制驻留并复用原生进程表与缩略图
This commit is contained in:
@@ -11,13 +11,10 @@ struct MetricRingGauge: View {
|
||||
var body: some View {
|
||||
VStack(spacing: 3) {
|
||||
ZStack {
|
||||
Circle().stroke(color.opacity(0.17), lineWidth: 3)
|
||||
Circle().trim(from: 0, to: fraction)
|
||||
.stroke(color, style: StrokeStyle(lineWidth: 3, lineCap: .round))
|
||||
.rotationEffect(.degrees(-90))
|
||||
NativeMetricRing(value: fraction, color: color, lineWidth: 3, trackOpacity: 0.17, inset: 2)
|
||||
AnimatedMetricText(value: MetricFormat.percent(value)).font(.system(size: 8, weight: .semibold))
|
||||
.lineLimit(1).minimumScaleFactor(0.6).frame(width: 18, height: 12)
|
||||
}.padding(2).frame(width: 28, height: 28).accessibilityHidden(true)
|
||||
}.frame(width: 28, height: 28).accessibilityHidden(true)
|
||||
Text(title).font(.system(size: 8)).foregroundStyle(.secondary)
|
||||
.lineLimit(1).minimumScaleFactor(0.7)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user