From ce28d212791564ac9f17c61df52c51d9e164045a Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Thu, 22 Aug 2019 08:10:35 -0400 Subject: [PATCH] Add setting to immediately hide previews on appicon click --- Settings.ui | 97 +++++++++++++------ appIcons.js | 2 +- prefs.js | 7 ++ ...shell.extensions.dash-to-panel.gschema.xml | 5 + 4 files changed, 81 insertions(+), 30 deletions(-) diff --git a/Settings.ui b/Settings.ui index e599d3c..17bc903 100644 --- a/Settings.ui +++ b/Settings.ui @@ -2264,35 +2264,6 @@ 0 - - - True - False - True - Time (ms) before hiding (100 is default) - 0 - - - 0 - 1 - - - - - True - True - end - 4 - 25 - leave_timeout_adjustment - True - 25 - - - 1 - 1 - - True @@ -2321,6 +2292,74 @@ 2 + + + True + False + vertical + + + True + False + True + Time (ms) before hiding (100 is default) + 0 + + + False + True + 0 + + + + + True + True + False + 12 + 4 + True + + + 4 + True + False + start + 4 + Immediate on application icon click + True + + + + + False + True + 1 + + + + + 0 + 1 + + + + + True + True + end + center + 4 + 25 + leave_timeout_adjustment + True + 25 + + + 1 + 1 + + diff --git a/appIcons.js b/appIcons.js index e7a6dd3..662cc94 100644 --- a/appIcons.js +++ b/appIcons.js @@ -748,7 +748,7 @@ var taskbarAppIcon = Utils.defineClass({ let appCount = this.getAppIconInterestingWindows().length; let previewedAppIcon = this._previewMenu.getCurrentAppIcon(); - this._previewMenu.close(); + this._previewMenu.close(this._dtpSettings.get_boolean('window-preview-hide-immediate-click')); // We check if the app is running, and that the # of windows is > 0 in // case we use workspace isolation, diff --git a/prefs.js b/prefs.js index f7d26c5..4eabbde 100644 --- a/prefs.js +++ b/prefs.js @@ -1102,6 +1102,11 @@ const Settings = new Lang.Class({ this._settings.set_int('leave-timeout', widget.get_value()); })); + this._settings.bind('window-preview-hide-immediate-click', + this._builder.get_object('preview_immediate_click_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._builder.get_object('animation_time_spinbutton').set_value(this._settings.get_int('window-preview-animation-time')); this._builder.get_object('animation_time_spinbutton').connect('value-changed', Lang.bind (this, function(widget) { this._settings.set_int('window-preview-animation-time', widget.get_value()); @@ -1157,6 +1162,8 @@ const Settings = new Lang.Class({ this._settings.set_value('leave-timeout', this._settings.get_default_value('leave-timeout')); this._builder.get_object('leave_timeout_spinbutton').set_value(this._settings.get_int('leave-timeout')); + this._settings.set_value('window-preview-hide-immediate-click', this._settings.get_default_value('window-preview-hide-immediate-click')); + this._settings.set_value('window-preview-animation-time', this._settings.get_default_value('window-preview-animation-time')); this._builder.get_object('animation_time_spinbutton').set_value(this._settings.get_int('window-preview-animation-time')); 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 0f24b99..5349a9d 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -471,6 +471,11 @@ Aspect ratio Y The window previews respected aspect ratio Y. + + false + Immediate hide on icon click + The window previews immediately hide when an application icon is clicked. + false Provide workspace isolation