How to draw NSProgressIndicator correctly on Big Sur NSStatusBar?

Viewed 90

enter image description here

enter image description here

enter image description here

Before OS X Big Sur it was working fine (screenshots 2 and 3) using this code:

let prog = NSProgressIndicator(frame: NSMakeRect(1, 2, 18, 18))
let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)

prog.style = .spinning
prog.isIndeterminate = false
statusItem.button?.addSubview(prog)
statusItem.menu = statusMenu

But after update, it appears with 4 corners and empty inside (first screenshot).

Any idea how to fix?

UPDATE 1: After following El Tomato suggestions:

prog.controlSize = .small
prog.controlTint = .blueControlTint
prog.appearance = NSAppearance(named: .vibrantLight)

it looks like this:

enter image description here

But how to make it look as in Catalina (Pie chart)

0 Answers
Related