fix(ui): 修正风扇转轴与速率图并精简进程表
This commit is contained in:
@@ -39,32 +39,11 @@ import SwiftUI
|
||||
}
|
||||
}
|
||||
}
|
||||
// Render the production memory distribution: real UInt64 capacities must form visible segments.
|
||||
window.appearance = NSAppearance(named: .aqua)
|
||||
let memory = MemoryMetrics(total: 48 << 30, used: 26 << 30, wired: 3 << 30,
|
||||
compressed: 1 << 30, swapUsed: 0, pressure: 1)
|
||||
host.rootView = AnyView(MemoryDetailsView(memory: memory)
|
||||
.frame(width: 185, height: 44, alignment: .topLeading)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
||||
.environment(\.colorScheme, .light))
|
||||
try? await Task.sleep(for: .milliseconds(120))
|
||||
host.layoutSubtreeIfNeeded()
|
||||
let bitmap = host.bitmapImageRepForCachingDisplay(in: host.bounds)!
|
||||
host.cacheDisplay(in: host.bounds, to: bitmap)
|
||||
var colored = 0
|
||||
for y in 0..<bitmap.pixelsHigh {
|
||||
for x in 0..<bitmap.pixelsWide {
|
||||
guard let c = bitmap.colorAt(x: x, y: y)?.usingColorSpace(.deviceRGB) else { continue }
|
||||
let components = [c.redComponent, c.greenComponent, c.blueComponent]
|
||||
if components.max()! - components.min()! > 0.2 && c.alphaComponent > 0.2 { colored += 1 }
|
||||
}
|
||||
}
|
||||
precondition(colored > 200, "Memory classification capacities must produce a visible proportion bar")
|
||||
host.rootView = AnyView(EmptyView())
|
||||
try? await Task.sleep(for: .milliseconds(100))
|
||||
precondition(descendants(host).allSatisfy { !($0 is NativePanelCurve.PlotView) })
|
||||
window.orderOut(nil); window.contentView = nil; window.close()
|
||||
print("PASS: production card geometry at 190/205⅓/400pt, light/dark, three languages, full-height chart overlay, memory distribution pixels and unmount")
|
||||
print("PASS: production card geometry at 190/205⅓/400pt, light/dark, three languages, full-height chart overlay, unmount")
|
||||
NSApp.terminate(nil)
|
||||
}
|
||||
NSApp.run()
|
||||
|
||||
Reference in New Issue
Block a user