Skip to content

Commit

Permalink
Add showProgressBar option (#155)
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
  • Loading branch information
jrainlau and sindresorhus authored Oct 9, 2022
1 parent 0641a2c commit ec49608
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
9 changes: 8 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,19 @@ declare namespace electronDl {
readonly openFolderWhenDone?: boolean;

/**
Shows the file count badge on macOS/Linux dock icons when download is in progress.
Show a file count badge on the macOS/Linux dock/taskbar icon when a download is in progress.
@default true
*/
readonly showBadge?: boolean;

/**
Show a progress bar on the dock/taskbar icon when a download is in progress.
@default true
*/
readonly showProgressBar?: boolean;

/**
Allow downloaded files to overwrite files with the same name in the directory they are saved to.
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function registerListener(session, options, callback = () => {}) {

options = {
showBadge: true,
showProgressBar: true,
...options
};

Expand Down Expand Up @@ -105,7 +106,7 @@ function registerListener(session, options, callback = () => {}) {
app.badgeCount = activeDownloadItems();
}

if (!window_.isDestroyed()) {
if (!window_.isDestroyed() && options.showProgressBar) {
window_.setProgressBar(progressDownloadItems());
}

Expand Down
9 changes: 8 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,14 @@ Reveal the downloaded file in the system file manager, and if possible, select t
Type: `boolean`\
Default: `true`

Shows the file count badge on macOS/Linux dock icons when download is in progress.
Show a file count badge on the macOS/Linux dock/taskbar icon when a download is in progress.

#### showProgressBar

Type: `boolean`\
Default: `true`

Show a progress bar on the dock/taskbar icon when a download is in progress.

#### overwrite

Expand Down

0 comments on commit ec49608

Please sign in to comment.