Add option to hide running application icons

This commit is contained in:
Charles Gagnon
2019-06-25 17:32:47 -04:00
parent a349beff32
commit 257f00125a
4 changed files with 44 additions and 3 deletions

View File

@@ -5497,6 +5497,7 @@
<property name="margin_right">12</property>
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
<property name="row_spacing">6</property>
<property name="column_spacing">32</property>
<child>
<object class="GtkSwitch" id="show_favorite_switch">
@@ -5511,7 +5512,7 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="shrink_dash_label1">
<object class="GtkLabel" id="show_favorite_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
@@ -5523,6 +5524,31 @@
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="show_runnning_apps_switch">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">end</property>
<property name="valign">center</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="show_running_apps_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Show running applications</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
</child>
</object>

View File

@@ -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);

View File

@@ -386,10 +386,15 @@
<summary>Show tooltip</summary>
<description>Show tooltip on hover of app icon</description>
</key>
<key type="b" name="show-running-apps">
<default>true</default>
<summary>Show running apps</summary>
<description>Show or hide running application icons in the dash</description>
</key>
<key type="b" name="show-favorites">
<default>true</default>
<summary>Show favorites apps</summary>
<description>Show or hide favorite appplications icons in the dash</description>
<description>Show or hide favorite application icons in the dash</description>
</key>
<key type="i" name="show-window-previews-timeout">
<default>100</default>

View File

@@ -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'));