Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add showProgressBar option #155

Merged
merged 3 commits into from
Oct 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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