Add option to modify the delay before enabling intellihide

This commit is contained in:
Charles Gagnon
2019-09-28 17:50:07 -04:00
parent 366f62ac21
commit ff4fb5a1e8
4 changed files with 67 additions and 1 deletions

View File

@@ -1656,6 +1656,11 @@
<property name="step_increment">10</property>
<property name="page_increment">100</property>
</object>
<object class="GtkAdjustment" id="intellihide_enable_hide_delay_adjustment">
<property name="upper">10000</property>
<property name="step_increment">10</property>
<property name="page_increment">100</property>
</object>
<object class="GtkAdjustment" id="intellihide_pressure_threshold_adjustment">
<property name="lower">1</property>
<property name="upper">9990</property>
@@ -2126,6 +2131,54 @@
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow" id="listboxrow_intellihide_enable_start_delay">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkGrid" id="grid_intellihide_enable_start_delay">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">12</property>
<property name="margin_right">12</property>
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
<property name="row_spacing">12</property>
<property name="column_spacing">32</property>
<child>
<object class="GtkLabel" id="intellihide_enable_start_delay_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Delay before enabling intellihide on start (ms)</property>
<property name="use_markup">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="intellihide_enable_start_delay_spinbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">end</property>
<property name="width_chars">4</property>
<property name="text">10</property>
<property name="adjustment">intellihide_enable_hide_delay_adjustment</property>
<property name="numeric">True</property>
<property name="value">10</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>

View File

@@ -280,7 +280,7 @@ var dtpPanel = Utils.defineClass({
if(this.taskbar._showAppsIconWrapper)
this.taskbar._showAppsIconWrapper._dtpPanel = this;
this.startIntellihideId = Mainloop.timeout_add(2000, () => {
this.startIntellihideId = Mainloop.timeout_add(Me.settings.get_int('intellihide-enable-start-delay'), () => {
this.startIntellihideId = 0;
this.intellihide = new Intellihide.Intellihide(this);
});

View File

@@ -821,6 +821,11 @@ const Settings = new Lang.Class({
this._settings.set_int('intellihide-close-delay', widget.get_value());
}));
this._builder.get_object('intellihide_enable_start_delay_spinbutton').set_value(this._settings.get_int('intellihide-enable-start-delay'));
this._builder.get_object('intellihide_enable_start_delay_spinbutton').connect('value-changed', Lang.bind (this, function(widget) {
this._settings.set_int('intellihide-enable-start-delay', widget.get_value());
}));
this._builder.get_object('intellihide_options_button').connect('clicked', Lang.bind(this, function() {
let dialog = new Gtk.Dialog({ title: _('Intellihide options'),
transient_for: this.widget.get_toplevel(),
@@ -856,6 +861,9 @@ const Settings = new Lang.Class({
this._settings.set_value('intellihide-close-delay', this._settings.get_default_value('intellihide-close-delay'));
this._builder.get_object('intellihide_close_delay_spinbutton').set_value(this._settings.get_int('intellihide-close-delay'));
this._settings.set_value('intellihide-enable-start-delay', this._settings.get_default_value('intellihide-enable-start-delay'));
this._builder.get_object('intellihide_enable_start_delay_spinbutton').set_value(this._settings.get_int('intellihide-enable-start-delay'));
} else {
// remove the settings box so it doesn't get destroyed;
dialog.get_content_area().remove(box);

View File

@@ -340,6 +340,11 @@
<summary>Keybinding toggle intellihide</summary>
<description>Keybinding to reveal the panel while in intellihide mode</description>
</key>
<key type="i" name="intellihide-enable-start-delay">
<default>2000</default>
<summary>Intellihide enable start delay</summary>
<description>The delay before enabling intellihide on start</description>
</key>
<key type="b" name="show-show-apps-button">
<default>true</default>
<summary>Show applications button</summary>