Fix formatting

This commit is contained in:
Romain Vigier
2020-06-15 09:54:34 +02:00
parent b7917d47b0
commit 6ee2b44d88
3 changed files with 18 additions and 18 deletions
+7 -7
View File
@@ -29,7 +29,7 @@ const { log_debug } = Me.imports.utils;
const { key_binding_auto_repeat, get_actor } = Me.imports.compat; const { key_binding_auto_repeat, get_actor } = Me.imports.compat;
/** /**
* The On-demand Timer allows the user to manually switch between the day and * The On-demand Timer allows the user to manually switch between the day and
* night variants with a button in the top bar and a keybinding. * night variants with a button in the top bar and a keybinding.
* *
* The user can change the key combination in the extension's preferences. * The user can change the key combination in the extension's preferences.
@@ -62,13 +62,13 @@ var TimerOndemand = class {
_add_keybinding() { _add_keybinding() {
log_debug('Adding On-demand Timer keybinding...'); log_debug('Adding On-demand Timer keybinding...');
// add our own keybinging handler // add our own keydinging handler
main.wm.addKeybinding( main.wm.addKeybinding(
'nightthemeswitcher-ondemand-keybinding', 'nightthemeswitcher-ondemand-keybinding',
e.settingsManager._extensionsSettings, e.settingsManager._extensionsSettings,
key_binding_auto_repeat(), key_binding_auto_repeat(),
Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
this._toggle_time.bind(this) this._toggle_time.bind(this)
); );
log_debug('Added On-demand Timer keybinding.'); log_debug('Added On-demand Timer keybinding.');
} }
+8 -8
View File
@@ -70,23 +70,23 @@ class KeyBindingControl {
const iter = list_store.append(); const iter = list_store.append();
const update_shortcut_row = (accel) => { const update_shortcut_row = (accel) => {
const [key, mods] = accel ? Gtk.accelerator_parse(accel) : [0, 0]; const [key, mods] = accel ? Gtk.accelerator_parse(accel) : [0, 0];
list_store.set(iter, [COLUMN_KEY, COLUMN_MODS], [key, mods]); list_store.set(iter, [COLUMN_KEY, COLUMN_MODS], [key, mods]);
}; };
renderer.connect('accel-edited', (renderer, path, key, mods) => { renderer.connect('accel-edited', (renderer, path, key, mods) => {
const accel = Gtk.accelerator_name(key, mods); const accel = Gtk.accelerator_name(key, mods);
update_shortcut_row(accel); update_shortcut_row(accel);
settings.set_strv(KEYBINDING_KEY, [accel]); settings.set_strv(KEYBINDING_KEY, [accel]);
}); });
renderer.connect('accel-cleared', () => { renderer.connect('accel-cleared', () => {
update_shortcut_row(null); update_shortcut_row(null);
settings.set_strv(KEYBINDING_KEY, []); settings.set_strv(KEYBINDING_KEY, []);
}); });
settings.connect(`changed::${KEYBINDING_KEY}`, () => { settings.connect(`changed::${KEYBINDING_KEY}`, () => {
update_shortcut_row(settings.get_strv(KEYBINDING_KEY)[0]); update_shortcut_row(settings.get_strv(KEYBINDING_KEY)[0]);
}); });
column.pack_start(renderer, true); column.pack_start(renderer, true);
@@ -102,9 +102,9 @@
<description>The current time used in on-demand mode</description> <description>The current time used in on-demand mode</description>
</key> </key>
<key name="nightthemeswitcher-ondemand-keybinding" type="as"> <key name="nightthemeswitcher-ondemand-keybinding" type="as">
<default><![CDATA[['<Shift><Super>t']]]></default> <default><![CDATA[['<Shift><Super>t']]]></default>
<summary>Key combination to toggle time</summary> <summary>Key combination to toggle time</summary>
<description>The key combination that will toggle time in on-demand mode</description> <description>The key combination that will toggle time in on-demand mode</description>
</key> </key>
<key name="manual-time-source" type="b"> <key name="manual-time-source" type="b">
<default>false</default> <default>false</default>