From 60656d7547eb6e9108f2007e51c45413498e102e Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Sun, 3 Feb 2019 10:16:31 -0500 Subject: [PATCH] Add option to hide appicon tooltips on hover --- Settings.ui | 30 +++++++++++++++++-- appIcons.js | 8 +++-- prefs.js | 10 ++++++- ...shell.extensions.dash-to-panel.gschema.xml | 5 ++++ 4 files changed, 47 insertions(+), 6 deletions(-) diff --git a/Settings.ui b/Settings.ui index 9b36800..9690589 100644 --- a/Settings.ui +++ b/Settings.ui @@ -5220,12 +5220,12 @@ - + 100 True True - + True False 12 @@ -5297,6 +5297,32 @@ 0 + + + True + True + end + center + + + 1 + 1 + + + + + True + False + True + Show tooltip on hover + True + 0 + + + 0 + 1 + + diff --git a/appIcons.js b/appIcons.js index add4294..10b0d11 100644 --- a/appIcons.js +++ b/appIcons.js @@ -314,8 +314,9 @@ var taskbarAppIcon = new Lang.Class({ }, shouldShowTooltip: function() { - if (!this.isLauncher && this._dtpSettings.get_boolean("show-window-previews") && - this.getAppIconInterestingWindows().length > 0) { + if (!this._dtpSettings.get_boolean('show-tooltip') || + (!this.isLauncher && this._dtpSettings.get_boolean("show-window-previews") && + this.getAppIconInterestingWindows().length > 0)) { return false; } else { return this.actor.hover && !this.window && @@ -1551,7 +1552,8 @@ var ShowAppsIconWrapper = new Lang.Class({ }, shouldShowTooltip: function() { - return this.actor.hover && (!this._menu || !this._menu.isOpen); + return this._dtpSettings.get_boolean('show-tooltip') && + (this.actor.hover && (!this._menu || !this._menu.isOpen)); }, destroy: function() { diff --git a/prefs.js b/prefs.js index ae8b37c..a1644c4 100644 --- a/prefs.js +++ b/prefs.js @@ -918,14 +918,22 @@ const Settings = new Lang.Class({ this._builder.get_object('show_appmenu_switch'), 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-window-previews', this._builder.get_object('show_window_previews_switch'), 'active', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('show-window-previews', + + this._settings.bind('show-window-previews', this._builder.get_object('show_window_previews_button'), 'sensitive', Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('show-tooltip', + this._builder.get_object('show_tooltip_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-favorites', this._builder.get_object('show_favorite_switch'), 'active', 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 ceccb12..97d2fef 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -360,6 +360,11 @@ Show window preview Show preview of running window on hover of app icon + + true + Show tooltip + Show tooltip on hover of app icon + true Show favorites apps