diff --git a/Settings.ui b/Settings.ui index 97fa7b6..c7baa2b 100644 --- a/Settings.ui +++ b/Settings.ui @@ -1378,11 +1378,15 @@ 12 32 - + True - True - end + False center + + Never + Show temporarily + Always visible + 1 @@ -1485,7 +1489,7 @@ 32 - False + True center 12 diff --git a/prefs.js b/prefs.js index a86f0ea..ff4090d 100644 --- a/prefs.js +++ b/prefs.js @@ -562,6 +562,10 @@ const Settings = new Lang.Class({ 'sensitive', Gio.SettingsBindFlags.DEFAULT); + this._builder.get_object('overlay_combo').connect('changed', Lang.bind (this, function(widget) { + this._settings.set_string('hotkeys-overlay-combo', widget.get_active_id()); + })); + // Create dialog for number overlay options this._builder.get_object('overlay_button').connect('clicked', Lang.bind(this, function() { @@ -577,8 +581,6 @@ const Settings = new Lang.Class({ let box = this._builder.get_object('box_overlay_shortcut'); dialog.get_content_area().add(box); - this._builder.get_object('overlay_switch').set_active(this._settings.get_boolean('hotkeys-overlay')); - this._settings.bind('hotkey-prefix-text', this._builder.get_object('hotkey_prefix_combo'), 'text', @@ -593,18 +595,27 @@ const Settings = new Lang.Class({ 'active-id', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('hotkeys-overlay', - this._builder.get_object('overlay_switch'), - 'active', + this._builder.get_object('overlay_combo').set_active_id(this._settings.get_string('hotkeys-overlay-combo')); + + this._settings.bind('hotkeys-overlay-combo', + this._builder.get_object('overlay_combo'), + 'active-id', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('overlay-timeout', this._builder.get_object('timeout_spinbutton'), 'value', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('hotkeys-overlay', - this._builder.get_object('timeout_spinbutton'), - 'sensitive', - Gio.SettingsBindFlags.DEFAULT); + if (this._settings.get_string('hotkeys-overlay-combo') !== 'TEMPORARILY') { + this._builder.get_object('timeout_spinbutton').set_sensitive(false); + } + + this._settings.connect('changed::hotkeys-overlay-combo', Lang.bind(this, function() { + if (this._settings.get_string('hotkeys-overlay-combo') !== 'TEMPORARILY') + this._builder.get_object('timeout_spinbutton').set_sensitive(false); + else + this._builder.get_object('timeout_spinbutton').set_sensitive(true); + })); this._settings.bind('shortcut-text', this._builder.get_object('shortcut_entry'), @@ -615,7 +626,7 @@ const Settings = new Lang.Class({ dialog.connect('response', Lang.bind(this, function(dialog, id) { if (id == 1) { // restore default settings for the relevant keys - let keys = ['hotkey-prefix-text', 'shortcut-text', 'hotkeys-overlay', 'overlay-timeout']; + let keys = ['hotkey-prefix-text', 'shortcut-text', 'hotkeys-overlay-combo', 'overlay-timeout']; keys.forEach(function(val) { this._settings.set_value(val, this._settings.get_default_value(val)); }, this); 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 d01bf89..3db1893 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -26,6 +26,11 @@ + + + + + @@ -291,6 +296,11 @@ Show the dock when using the hotkeys The dock will be quickly shown so that the number-overlay is visible and app activation is easier + + 'TEMPORARILY' + Transitivity of the number overlay + You can choose between NEVER, TEMPORARILY and ALWAYS. + false Super Hot-Keys