sindresorhus/DockProgress

Badge does not get removed from icon after calling DockProgress.resetProgress() #16

jordibruin posted onGitHub

Again, lovely work @sindresorhus !

Trying to implement it into MacWhisper (www.macwhisper.com) but running into an issue. After the progress is complete and I call DockProgress.resetProgress(), the badge remains visible on the icon.

Any idea what could be causing this?

Relevant code:

`func whisper(_ aWhisper: Whisper, didUpdateProgress progress: Float) {
    self.progress = progress
    DockProgress.style = .badge(badgeValue: {
        Int(progress * 100)
    })
    DockProgress.progress = Double(progress)
}

@MainActor
func whisper(_ aWhisper: Whisper, didCompleteWithSegments segments: [Segment]) {
    DockProgress.progress = Double(1)
    DockProgress.resetProgress()`

I'll look into it.

posted by sindresorhus about 2 years ago

Please note:

Note: The badgeValue is not meant to be used as a numeric percentage. It's for things like count of downloads, number of files being converted, etc.

There's really no need to show a percentage number and a progress circle. That's just needless noise to the user.

I do wish I had a pie style though. Like the badge style, but no text, just a filled circle pie.

posted by sindresorhus about 2 years ago
posted by sindresorhus about 2 years ago
posted by sindresorhus about 2 years ago

Fund this Issue

$0.00
Funded

Pull requests