diff --git a/panel.js b/panel.js index ce8b6c6..4514e70 100644 --- a/panel.js +++ b/panel.js @@ -413,7 +413,7 @@ var dtpPanel = Utils.defineClass({ // This saves significant CPU when repainting the screen. this.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS); - this.progressManager = new Progress.ProgressManager(); + this._initProgressManager(); }, disable: function () { @@ -550,7 +550,17 @@ var dtpPanel = Utils.defineClass({ this._formatVerticalClock(); } } - ] + ], + [ + Me.settings, + 'changed::progress-show-bar', + () => this._initProgressManager() + ], + [ + Me.settings, + 'changed::progress-show-count', + () => this._initProgressManager() + ], ); if (isVertical) { @@ -1154,7 +1164,12 @@ var dtpPanel = Utils.defineClass({ let ignoredConstr = ['WorkspaceIndicator']; return source._dtpIgnoreScroll || ignoredConstr.indexOf(source.constructor.name) >= 0; - } + }, + + _initProgressManager: function() { + if(!this.progressManager && (Me.settings.get_boolean('progress-show-bar') || Me.settings.get_boolean('progress-show-count'))) + this.progressManager = new Progress.ProgressManager(); + }, }); var dtpSecondaryAggregateMenu = Utils.defineClass({ diff --git a/progress.js b/progress.js index 6540f39..db1d0b3 100644 --- a/progress.js +++ b/progress.js @@ -252,11 +252,11 @@ var AppProgress = Utils.defineClass({ if (property == 'count') { this.setCount(other[property].get_int64()); } else if (property == 'count-visible') { - this.setCountVisible(other[property].get_boolean()); - } if (property == 'progress') { + this.setCountVisible(Me.settings.get_boolean('progress-show-count') && other[property].get_boolean()); + } else if (property == 'progress') { this.setProgress(other[property].get_double()); } else if (property == 'progress-visible') { - this.setProgressVisible(other[property].get_boolean()); + this.setProgressVisible(Me.settings.get_boolean('progress-show-bar') && other[property].get_boolean()); } else { // Not implemented yet } diff --git a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml index cfc6754..acbd651 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -1181,5 +1181,15 @@ Keybinding to either show or launch the 10th application in the dash. + + true + Show progress bar on app icon + Whether to show progress bar overlay on app icon, for supported applications. + + + true + Show badge count on app icon + Whether to show badge count overlay on app icon, for supported applications. +