diff --git a/area.js b/area.js index aad49e2..2684308 100644 --- a/area.js +++ b/area.js @@ -930,9 +930,12 @@ var DrawingArea = new Lang.Class({ `${_(FontStyleNames[this.currentFontStyle])}`, "", -1, false); }, - switchFontFamily: function() { + switchFontFamily: function(reverse) { let index = Math.max(0, this.fontFamilies.indexOf(this.currentFontFamily)); - this.currentFontFamily = (index == this.fontFamilies.length - 1) ? 0 : this.fontFamilies[index + 1]; + if (reverse) + this.currentFontFamily = (index == 0) ? this.fontFamilies[this.fontFamilies.length - 1] : this.fontFamilies[index - 1]; + else + this.currentFontFamily = (index == this.fontFamilies.length - 1) ? this.fontFamilies[0] : this.fontFamilies[index + 1]; if (this.currentElement && this.currentElement.font) { this.currentElement.font.family = this.currentFontFamily; this._redisplay(); diff --git a/extension.js b/extension.js index b0f964d..a253683 100644 --- a/extension.js +++ b/extension.js @@ -215,7 +215,8 @@ var AreaManager = new Lang.Class({ 'toggle-background': this.activeArea.toggleBackground.bind(this.activeArea), 'toggle-grid': this.activeArea.toggleGrid.bind(this.activeArea), 'toggle-square-area': this.activeArea.toggleSquareArea.bind(this.activeArea), - 'switch-font-family': this.activeArea.switchFontFamily.bind(this.activeArea), + 'reverse-switch-font-family': this.activeArea.switchFontFamily.bind(this.activeArea, true), + 'switch-font-family': this.activeArea.switchFontFamily.bind(this.activeArea, false), 'switch-font-weight': this.activeArea.switchFontWeight.bind(this.activeArea), 'switch-font-style': this.activeArea.switchFontStyle.bind(this.activeArea), 'switch-text-alignment': this.activeArea.switchTextAlignment.bind(this.activeArea), diff --git a/locale/draw-on-your-screen.pot b/locale/draw-on-your-screen.pot index 7ff6129..15ef699 100644 --- a/locale/draw-on-your-screen.pot +++ b/locale/draw-on-your-screen.pot @@ -218,7 +218,10 @@ msgstr "" msgid "Toggle fill rule" msgstr "" -msgid "Change font family (generic name)" +msgid "Change font family" +msgstr "" + +msgid "Change font family (reverse)" msgstr "" msgid "Change font weight" diff --git a/prefs.js b/prefs.js index 91abf81..8ff013d 100644 --- a/prefs.js +++ b/prefs.js @@ -70,7 +70,8 @@ var INTERNAL_KEYBINDINGS = { 'switch-linecap': "Change linecap", 'switch-dash': "Dashed line", '-separator-4': '', - 'switch-font-family': "Change font family (generic name)", + 'switch-font-family': "Change font family", + 'reverse-switch-font-family': "Change font family (reverse)", 'switch-font-weight': "Change font weight", 'switch-font-style': "Change font style", 'switch-text-alignment': "Toggle text alignment", diff --git a/schemas/gschemas.compiled b/schemas/gschemas.compiled index e05b0aa..92584ee 100644 Binary files a/schemas/gschemas.compiled and b/schemas/gschemas.compiled differ diff --git a/schemas/org.gnome.shell.extensions.draw-on-your-screen.gschema.xml b/schemas/org.gnome.shell.extensions.draw-on-your-screen.gschema.xml index 36065fa..4fe2746 100644 --- a/schemas/org.gnome.shell.extensions.draw-on-your-screen.gschema.xml +++ b/schemas/org.gnome.shell.extensions.draw-on-your-screen.gschema.xml @@ -226,6 +226,11 @@ switch font family switch font family + + ["<Primary><Shift>f"] + switch font family (reverse) + switch font family (reverse) + ["<Primary>w"] switch font weight