From e6353e504543555ddac2be86d0bb3ac4b1488230 Mon Sep 17 00:00:00 2001 From: "Romain F. T" Date: Sat, 20 Nov 2021 10:54:23 +0100 Subject: [PATCH] stylistic changes following the merge of #65 --- notes@maestroschan.fr/extension.js | 26 +- notes@maestroschan.fr/prefs.js | 1 - notes@maestroschan.fr/prefs.ui | 228 ++++++++---------- ...ell.extensions.notes-extension.gschema.xml | 5 +- 4 files changed, 119 insertions(+), 141 deletions(-) diff --git a/notes@maestroschan.fr/extension.js b/notes@maestroschan.fr/extension.js index 1134200..35f7554 100644 --- a/notes@maestroschan.fr/extension.js +++ b/notes@maestroschan.fr/extension.js @@ -87,14 +87,14 @@ class NotesManager { // notes need to be loaded first, thus doing the actual initilisation // Initialisation of the signals connections - this._bindShortcut(); + this._bindVisibilityShortcut(); this._bindLayerShortcut(); this._connectAllSignals(); } - _bindShortcut () { - this.USE_SHORTCUT = Convenience.getSettings().get_boolean('use-shortcut'); - if (this.USE_SHORTCUT) { + _bindVisibilityShortcut () { + this.USE_VISIBILITY_SHORTCUT = Convenience.getSettings().get_boolean('use-shortcut'); + if (this.USE_VISIBILITY_SHORTCUT) { Main.wm.addKeybinding( 'notes-kb-shortcut', Convenience.getSettings(), @@ -182,18 +182,14 @@ class NotesManager { //-------------------------------------------------------------------------- _toggleLayer () { - switch (SETTINGS.get_string('layout-position')) { - case 'above-all': - SETTINGS.set_string('layout-position', 'on-background'); - break; - case 'on-background': - SETTINGS.set_string('layout-position', 'above-all'); - break; + if(SETTINGS.get_string('layout-position') === 'above-all') { + SETTINGS.set_string('layout-position', 'on-background'); + } else { // 'on-background': + SETTINGS.set_string('layout-position', 'above-all'); } } _toggleState () { - if(!this._notesLoaded) { this._loadAllNotes(); } @@ -284,10 +280,10 @@ class NotesManager { } _updateShortcut () { - if(this.USE_SHORTCUT) { + if(this.USE_VISIBILITY_SHORTCUT) { Main.wm.removeKeybinding('notes-kb-shortcut'); } - this._bindShortcut(); + this._bindVisibilityShortcut(); } _updateLayerShortcut () { @@ -354,7 +350,7 @@ class NotesManager { n.destroy(); }); - if(this.USE_SHORTCUT) { + if(this.USE_VISIBILITY_SHORTCUT) { Main.wm.removeKeybinding('notes-kb-shortcut'); } if(this.USE_LAYER_SHORTCUT) { diff --git a/notes@maestroschan.fr/prefs.js b/notes@maestroschan.fr/prefs.js index bbceae5..0dc9f12 100644 --- a/notes@maestroschan.fr/prefs.js +++ b/notes@maestroschan.fr/prefs.js @@ -121,7 +121,6 @@ const NotesSettingsWidget = new GObject.Class({ this._hide_switch.sensitive = widget.active; }); - // Context: %s will be replaced with the default keyboard shortcut let default_kbs_label2 = _("Default value is %s"); default_kbs_label2 = default_kbs_label2.replace('%s', "j"); diff --git a/notes@maestroschan.fr/prefs.ui b/notes@maestroschan.fr/prefs.ui index 2aad1bd..38ba4ba 100644 --- a/notes@maestroschan.fr/prefs.ui +++ b/notes@maestroschan.fr/prefs.ui @@ -91,35 +91,72 @@ - + False + end + + Use a keyboard shortcut to toggle notes position 0 - 10 - 2 + 8 + + + + + False + start + + + 1 + 8 - - end + False - Automatic focus + end + + + + + + Help + help-popover-1 + + + 2 + + + help-faq-symbolic + + + + + pan-down-symbolic + + + + + + + 0 - 11 + 9 - + False start + Apply 1 - 11 + 9 @@ -129,88 +166,41 @@ 0 - 14 + 10 2 - False end - Toggle notes layer - Use a keyboard shortcut to toggle notes layer (toggle between "Above everything" and "On the background") + False + Automatic focus 0 - 15 + 11 - - False - end - - - - - - Help - help-popover-1 - - - 2 - - - help-faq-symbolic - - - - - pan-down-symbolic - - - - - - - - + + False + start + - 0 - 16 + 1 + 11 + - - False - fill - - - False - start - Apply - - - 1 - start - - - - - False - start - center - - - 2 - end - - + + False - 1 - 16 + 0 + 15 + 2 @@ -218,8 +208,8 @@ False end - Toggle notes visibility - Use a keyboard shortcut to toggle notes visibility (toggle between "Show" and "Hide") + + Use a keyboard shortcut to toggle notes visibility 0 @@ -227,72 +217,63 @@ - - False - end - - - + + False + start + + + 1 + 17 + + + + + + False + end + + + + + + Help + help-popover-1 - - Help - help-popover-1 + + 2 - - 2 - - - help-faq-symbolic - - - - - pan-down-symbolic - - + + help-faq-symbolic + + + + + pan-down-symbolic - + + + 0 18 - - False - fill - - - False - start - Apply - - - 1 - start - - - - - False - start - center - - - 2 - end - - + + False + start + Apply - 1 - 18 + 1 + 18 + end @@ -804,3 +785,4 @@ + diff --git a/notes@maestroschan.fr/schemas/org.gnome.shell.extensions.notes-extension.gschema.xml b/notes@maestroschan.fr/schemas/org.gnome.shell.extensions.notes-extension.gschema.xml index a90675e..4660154 100644 --- a/notes@maestroschan.fr/schemas/org.gnome.shell.extensions.notes-extension.gschema.xml +++ b/notes@maestroschan.fr/schemas/org.gnome.shell.extensions.notes-extension.gschema.xml @@ -48,15 +48,16 @@ Should be true only if there is shortcut. + false Keyboard shortcut - If the keyboard shortcut should be active + If the keyboard shortcut concerning layers should be active j','']]]> Keyboard shortcut value - Keyboard shortcut which toggles layer of notes. + Keyboard shortcut which changes the layer of the notes.