From 257f00125ae3663f671ab94ffda75b58316989d0 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Tue, 25 Jun 2019 17:32:47 -0400 Subject: [PATCH] Add option to hide running application icons --- Settings.ui | 28 ++++++++++++++++++- prefs.js | 5 ++++ ...shell.extensions.dash-to-panel.gschema.xml | 7 ++++- taskbar.js | 7 ++++- 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/Settings.ui b/Settings.ui index 3c21cb2..8ce762e 100644 --- a/Settings.ui +++ b/Settings.ui @@ -5497,6 +5497,7 @@ 12 12 12 + 6 32 @@ -5511,7 +5512,7 @@ - + True False True @@ -5523,6 +5524,31 @@ 0 + + + True + True + end + center + + + 1 + 1 + + + + + True + False + True + Show running applications + 0 + + + 0 + 1 + + diff --git a/prefs.js b/prefs.js index b7db252..58c37ca 100644 --- a/prefs.js +++ b/prefs.js @@ -990,6 +990,11 @@ const Settings = new Lang.Class({ 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-running-apps', + this._builder.get_object('show_runnning_apps_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + switch (this._settings.get_string('window-preview-title-position')) { case 'BOTTOM': this._builder.get_object('preview_title_position_bottom_button').set_active(true); 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 fe51f6f..2d5fa11 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -386,10 +386,15 @@ Show tooltip Show tooltip on hover of app icon + + true + Show running apps + Show or hide running application icons in the dash + true Show favorites apps - Show or hide favorite appplications icons in the dash + Show or hide favorite application icons in the dash 100 diff --git a/taskbar.js b/taskbar.js index de99965..b8f5a92 100644 --- a/taskbar.js +++ b/taskbar.js @@ -328,6 +328,7 @@ var taskbar = Utils.defineClass({ [ 'changed::dot-size', 'changed::show-favorites', + 'changed::show-running-apps', 'changed::show-favorites-all-monitors' ], Lang.bind(this, this._redisplay) @@ -754,7 +755,7 @@ var taskbar = Utils.defineClass({ //find the apps that should be in the taskbar: the favorites first, then add the running apps // When using isolation, we filter out apps that have no windows in // the current workspace (this check is done in AppIcons.getInterestingWindows) - let runningApps = this._getRunningApps().sort(this.sortAppsCompareFunction.bind(this)); + let runningApps = this._checkIfShowingRunningApps() ? this._getRunningApps().sort(this.sortAppsCompareFunction.bind(this)) : []; let expectedAppInfos; if (!this.isGroupApps && this._dtpSettings.get_boolean('group-apps-use-launchers')) { @@ -830,6 +831,10 @@ var taskbar = Utils.defineClass({ this._shownInitially = true; }, + _checkIfShowingRunningApps: function() { + return this._dtpSettings.get_boolean('show-running-apps'); + }, + _checkIfShowingFavorites: function() { return this._dtpSettings.get_boolean('show-favorites') && (!this.panelWrapper.isSecondary || this._dtpSettings.get_boolean('show-favorites-all-monitors'));