Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

sindresorhus/DockProgress

Repository files navigation

Show progress in your app's Dock icon

Requirements

macOS 10.15+

Install

Addhttps://github.com/sindresorhus/DockProgress in the“Swift Package Manager” tab in Xcode.

Latest version: 4.3.1

API

See the API docs.

Usage

Manually set the progress

import DockProgressfoo.onUpdate={ progressinDockProgress.progress= progress}
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.

Styles

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).

Bar

import DockProgressDockProgress.style=.bar

This is the default.

Squircle

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.

Circle

import DockProgressDockProgress.style=.circle(radius:55, color:.systemBlue)

Badge

import DockProgressDockProgress.style=.badge(color:.systemBlue, badgeValue:{getDownloadCount()})

LargebadgeValue numbers will be written in kilo short notation, for example,10121k.

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.

Pie

import DockProgressDockProgress.style=.pie(color:.systemBlue)

Related

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp