Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork59
Show progress in your app's Dock icon
License
sindresorhus/DockProgress
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Show progress in your app's Dock icon
macOS 10.15+
Addhttps://github.com/sindresorhus/DockProgress
in the“Swift Package Manager” tab in Xcode.
Latest version: 4.3.1
import DockProgressfoo.onUpdate={ progressinDockProgress.progress= progress}
Specify aProgress
instance
import Foundationimport DockProgressletprogress=Progress(totalUnitCount:1)progress?.becomeCurrent(withPendingUnitCount:1)DockProgress.progressInstance= progress
The givenProgress
instance is weakly stored. It's up to you to retain it.
It comes with five styles. PR welcome for more.
Check out the example app in the Xcode project.
You can also draw a custom progress with.custom(drawHandler: (_ rect: CGRect) -> Void)
.
import DockProgressDockProgress.style=.bar
This is the default.
import DockProgressDockProgress.style=.squircle(color:.white.withAlphaComponent(0.5))
By default, it should perfectly fit a macOS 11 and later icon, but there is aninset
parameter if you need to make any adjustments.
import DockProgressDockProgress.style=.circle(radius:55, color:.systemBlue)
import DockProgressDockProgress.style=.badge(color:.systemBlue, badgeValue:{getDownloadCount()})
LargebadgeValue
numbers will be written in kilo short notation, for example,1012
→1k
.
Note: ThebadgeValue
is not meant to be used as a numeric percentage. It's for things like count of downloads, number of files being converted, etc.
import DockProgressDockProgress.style=.pie(color:.systemBlue)
- Defaults - Swifty and modern UserDefaults
- KeyboardShortcuts - Add user-customizable global keyboard shortcuts to your macOS app
- LaunchAtLogin - Add "Launch at Login" functionality to your macOS app
- More…
About
Show progress in your app's Dock icon
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.