diff --git a/Settings.ui b/Settings.ui index 9220728..1b12929 100644 --- a/Settings.ui +++ b/Settings.ui @@ -239,9 +239,6 @@ - - - False @@ -255,6 +252,100 @@ 1 5 + + 9999 + 25 + 100 + + + True + False + vertical + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Preview timeout on icon leave (ms) + 0 + + + 0 + 0 + + + + + True + False + True + If set too low, the window preview of running applications may seem to close too quickly when trying to enter the popup. If set too high, the taskbar may feel slow to highlight applications. + True + 40 + 0 + + + + 0 + 1 + 2 + + + + + True + True + 4 + leave_timeout_adjustment + True + + + 1 + 0 + + + + + + + + + + + False + True + 0 + + + 0.33000000000000002 1 @@ -731,11 +822,9 @@ 0 1 + 2 - - - @@ -928,9 +1017,6 @@ 0 - - - False @@ -1051,11 +1137,22 @@ False True - 2 + 1 - + + Advanced Options + True + True + True + start + + + False + True + 2 + diff --git a/prefs.js b/prefs.js index cfce1a9..7986701 100644 --- a/prefs.js +++ b/prefs.js @@ -232,6 +232,44 @@ const Settings = new Lang.Class({ })); + // setup dialog for advanced options + this._builder.get_object('button_advanced_options').connect('clicked', Lang.bind(this, function() { + + let dialog = new Gtk.Dialog({ title: _('Advanced Options'), + transient_for: this.widget.get_toplevel(), + use_header_bar: true, + modal: true }); + + // GTK+ leaves positive values for application-defined response ids. + // Use +1 for the reset action + dialog.add_button(_('Reset to defaults'), 1); + + let box = this._builder.get_object('box_advanced_options'); + dialog.get_content_area().add(box); + + this._builder.get_object('leave_timeout_spinbutton').set_value(this._settings.get_int('leave-timeout')); + + this._builder.get_object('leave_timeout_spinbutton').connect('changed', Lang.bind (this, function(widget) { + this._settings.set_int('leave-timeout', widget.get_value()); + })); + + dialog.connect('response', Lang.bind(this, function(dialog, id) { + if (id == 1) { + // restore default settings + this._settings.set_int('leave-timeout', 100); + this._builder.get_object('leave_timeout_spinbutton').set_value(this._settings.get_int('leave-timeout')); + } else { + // remove the settings box so it doesn't get destroyed; + dialog.get_content_area().remove(box); + dialog.destroy(); + } + return; + })); + + dialog.show_all(); + + })); + // Appearance panel let sizeScales = [ 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 0711e95..bfd42db 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -107,6 +107,11 @@ Action when clicking on a running app Set the action that is executed when shift+middle-clicking on the icon of a running application + + 100 + Icon leave preview timeout + Amount of time to leave preview windows open when the mouse has left the application's icon. + 0 Tray font size diff --git a/windowPreview.js b/windowPreview.js index b54499b..87b34f2 100644 --- a/windowPreview.js +++ b/windowPreview.js @@ -130,7 +130,7 @@ const thumbnailPreviewMenu = new Lang.Class({ this.shouldClose = true; this.shouldOpen = false; - Mainloop.timeout_add(100, Lang.bind(this, this.hoverClose)); + Mainloop.timeout_add(this._dtpSettings.get_int('leave-timeout'), Lang.bind(this, this.hoverClose)); }, hoverOpen: function () {