New Number Overlay option

This commit is contained in:
franglais125
2017-05-26 18:22:06 -04:00
parent 8055f29499
commit eef0982e6d
3 changed files with 39 additions and 14 deletions

View File

@@ -1378,11 +1378,15 @@
<property name="margin_bottom">12</property>
<property name="column_spacing">32</property>
<child>
<object class="GtkSwitch" id="overlay_switch">
<object class="GtkComboBoxText" id="overlay_combo">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">end</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<items>
<item id="NEVER" translatable="yes">Never</item>
<item id="TEMPORARILY" translatable="yes">Show temporarily</item>
<item id="ALWAYS" translatable="yes">Always visible</item>
</items>
</object>
<packing>
<property name="left_attach">1</property>
@@ -1485,7 +1489,7 @@
<property name="column_spacing">32</property>
<child>
<object class="GtkEntry" id="shortcut_entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="width_chars">12</property>
</object>

View File

@@ -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);

View File

@@ -26,6 +26,11 @@
<value value='0' nick='Super'/>
<value value='1' nick='SuperAlt'/>
</enum>
<enum id='org.gnome.shell.extensions.dash-to-panel.hotkeyOverlay'>
<value value='0' nick='NEVER'/>
<value value='1' nick='TEMPORARILY'/>
<value value='2' nick='ALWAYS'/>
</enum>
<!-- this is mean to Match StSide. LEFT and RIGHT actual position in reversed in
rtl languages -->
<enum id='org.gnome.shell.extensions.dash-to-panel.panelPosition'>
@@ -291,6 +296,11 @@
<summary>Show the dock when using the hotkeys</summary>
<description>The dock will be quickly shown so that the number-overlay is visible and app activation is easier</description>
</key>
<key name="hotkeys-overlay-combo" enum="org.gnome.shell.extensions.dash-to-panel.hotkeyOverlay">
<default>'TEMPORARILY'</default>
<summary>Transitivity of the number overlay</summary>
<description>You can choose between NEVER, TEMPORARILY and ALWAYS.</description>
</key>
<key type="b" name="hot-keys">
<default>false</default>
<summary>Super Hot-Keys</summary>