diff --git a/area.js b/area.js index 775bdeb..aad49e2 100644 --- a/area.js +++ b/area.js @@ -324,7 +324,7 @@ var DrawingArea = new Lang.Class({ } return Clutter.EVENT_STOP; } else if (button == 2) { - this.toggleFill(); + this.switchFill(); } else if (button == 3) { this._stopDrawing(); this.menu.open(x, y); @@ -858,7 +858,7 @@ var DrawingArea = new Lang.Class({ } }, - toggleColor: function() { + switchColor: function() { this.selectColor((this.currentColor == this.colors[1]) ? 2 : 1); }, @@ -878,12 +878,12 @@ var DrawingArea = new Lang.Class({ this.updatePointerCursor(); }, - toggleFill: function() { + switchFill: function() { this.fill = !this.fill; this.emit('show-osd', null, this.fill ? _("Fill") : _("Outline"), "", -1, false); }, - toggleDash: function() { + switchDash: function() { this.dashedLine = !this.dashedLine; this.emit('show-osd', null, this.dashedLine ? _("Dashed line") : _("Full line"), "", -1, false); }, @@ -893,22 +893,22 @@ var DrawingArea = new Lang.Class({ this.emit('show-osd', null, _("%d px").format(this.currentLineWidth), "", 2 * this.currentLineWidth, false); }, - toggleLineJoin: function() { + switchLineJoin: function() { this.currentLineJoin = this.currentLineJoin == 2 ? 0 : this.currentLineJoin + 1; this.emit('show-osd', null, _(LineJoinNames[this.currentLineJoin]), "", -1, false); }, - toggleLineCap: function() { + switchLineCap: function() { this.currentLineCap = this.currentLineCap == 2 ? 0 : this.currentLineCap + 1; this.emit('show-osd', null, _(LineCapNames[this.currentLineCap]), "", -1, false); }, - toggleFillRule: function() { + switchFillRule: function() { this.currentFillRule = this.currentFillRule == 1 ? 0 : this.currentFillRule + 1; this.emit('show-osd', null, _(FillRuleNames[this.currentFillRule]), "", -1, false); }, - toggleFontWeight: function() { + switchFontWeight: function() { let fontWeights = Object.keys(FontWeightNames).map(key => Number(key)); let index = fontWeights.indexOf(this.currentFontWeight); this.currentFontWeight = index == fontWeights.length - 1 ? fontWeights[0] : fontWeights[index + 1]; @@ -920,7 +920,7 @@ var DrawingArea = new Lang.Class({ `${_(FontWeightNames[this.currentFontWeight])}`, "", -1, false); }, - toggleFontStyle: function() { + switchFontStyle: function() { this.currentFontStyle = this.currentFontStyle == 2 ? 0 : this.currentFontStyle + 1; if (this.currentElement && this.currentElement.font) { this.currentElement.font.style = this.currentFontStyle; @@ -930,7 +930,7 @@ var DrawingArea = new Lang.Class({ `${_(FontStyleNames[this.currentFontStyle])}`, "", -1, false); }, - toggleFontFamily: function() { + switchFontFamily: function() { let index = Math.max(0, this.fontFamilies.indexOf(this.currentFontFamily)); this.currentFontFamily = (index == this.fontFamilies.length - 1) ? 0 : this.fontFamilies[index + 1]; if (this.currentElement && this.currentElement.font) { @@ -940,7 +940,7 @@ var DrawingArea = new Lang.Class({ this.emit('show-osd', null, `${_(this.currentFontFamily)}`, "", -1, false); }, - toggleTextAlignment: function() { + switchTextAlignment: function() { this.currentTextRightAligned = !this.currentTextRightAligned; if (this.currentElement && this.currentElement.textRightAligned !== undefined) { this.currentElement.textRightAligned = this.currentTextRightAligned; @@ -949,7 +949,7 @@ var DrawingArea = new Lang.Class({ this.emit('show-osd', null, this.currentTextRightAligned ? _("Right aligned") : _("Left aligned"), "", -1, false); }, - toggleImageFile: function() { + switchImageFile: function() { let images = this.getImages(); if (!images.length) return; diff --git a/extension.js b/extension.js index 42011a6..b0f964d 100644 --- a/extension.js +++ b/extension.js @@ -187,12 +187,12 @@ var AreaManager = new Lang.Class({ 'decrement-line-width': () => this.activeArea.incrementLineWidth(-1), 'increment-line-width-more': () => this.activeArea.incrementLineWidth(5), 'decrement-line-width-more': () => this.activeArea.incrementLineWidth(-5), - 'toggle-linejoin': this.activeArea.toggleLineJoin.bind(this.activeArea), - 'toggle-linecap': this.activeArea.toggleLineCap.bind(this.activeArea), - 'toggle-fill-rule': this.activeArea.toggleFillRule.bind(this.activeArea), - 'toggle-dash' : this.activeArea.toggleDash.bind(this.activeArea), - 'toggle-fill' : this.activeArea.toggleFill.bind(this.activeArea), - 'toggle-image-file' : this.activeArea.toggleImageFile.bind(this.activeArea), + 'switch-linejoin': this.activeArea.switchLineJoin.bind(this.activeArea), + 'switch-linecap': this.activeArea.switchLineCap.bind(this.activeArea), + 'switch-fill-rule': this.activeArea.switchFillRule.bind(this.activeArea), + 'switch-dash' : this.activeArea.switchDash.bind(this.activeArea), + 'switch-fill' : this.activeArea.switchFill.bind(this.activeArea), + 'switch-image-file' : this.activeArea.switchImageFile.bind(this.activeArea), 'select-none-shape': () => this.activeArea.selectTool(Area.Tools.NONE), 'select-line-shape': () => this.activeArea.selectTool(Area.Tools.LINE), 'select-ellipse-shape': () => this.activeArea.selectTool(Area.Tools.ELLIPSE), @@ -215,10 +215,10 @@ 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), - 'toggle-font-family': this.activeArea.toggleFontFamily.bind(this.activeArea), - 'toggle-font-weight': this.activeArea.toggleFontWeight.bind(this.activeArea), - 'toggle-font-style': this.activeArea.toggleFontStyle.bind(this.activeArea), - 'toggle-text-alignment': this.activeArea.toggleTextAlignment.bind(this.activeArea), + 'switch-font-family': this.activeArea.switchFontFamily.bind(this.activeArea), + '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), 'toggle-panel-and-dock-visibility': this.togglePanelAndDockOpacity.bind(this), 'toggle-help': this.activeArea.toggleHelp.bind(this.activeArea), 'open-user-stylesheet': this.openUserStyleFile.bind(this), diff --git a/prefs.js b/prefs.js index 6939652..91abf81 100644 --- a/prefs.js +++ b/prefs.js @@ -59,22 +59,22 @@ var INTERNAL_KEYBINDINGS = { 'select-resize-tool': "Select resize", 'select-mirror-tool': "Select mirror", '-separator-2': '', - 'toggle-fill': "Toggle fill/outline", - 'toggle-fill-rule': "Toggle fill rule", + 'switch-fill': "Toggle fill/outline", + 'switch-fill-rule': "Toggle fill rule", '-separator-3': '', 'increment-line-width': "Increment line width", 'decrement-line-width': "Decrement line width", 'increment-line-width-more': "Increment line width even more", 'decrement-line-width-more': "Decrement line width even more", - 'toggle-linejoin': "Change linejoin", - 'toggle-linecap': "Change linecap", - 'toggle-dash': "Dashed line", + 'switch-linejoin': "Change linejoin", + 'switch-linecap': "Change linecap", + 'switch-dash': "Dashed line", '-separator-4': '', - 'toggle-font-family': "Change font family (generic name)", - 'toggle-font-weight': "Change font weight", - 'toggle-font-style': "Change font style", - 'toggle-text-alignment': "Toggle text alignment", - 'toggle-image-file': "Change image file", + 'switch-font-family': "Change font family (generic name)", + 'switch-font-weight': "Change font weight", + 'switch-font-style': "Change font style", + 'switch-text-alignment': "Toggle text alignment", + 'switch-image-file': "Change image file", '-separator-5': '', 'toggle-panel-and-dock-visibility': "Hide panel and dock", 'toggle-background': "Add a drawing background", diff --git a/schemas/gschemas.compiled b/schemas/gschemas.compiled index 61bc640..e05b0aa 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 683fbcb..36065fa 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 @@ -151,30 +151,30 @@ decrement the line width even more decrement the line width even more - + ["<Primary>j"] - toggle linejoin - toggle linejoin + switch linejoin + switch linejoin - + ["<Primary>k"] - toggle linecap - toggle linecap + switch linecap + switch linecap - + KP_Multiply','asterisk','asterisk']]]> - toggle fill rule - toggle fill rule + switch fill rule + switch fill rule - + ["<Primary>period"] - toggle dash - toggle dash + switch dash + switch dash - + ["<Primary>a"] - toggle fill - toggle fill + switch fill + switch fill KP_1','1']]]> @@ -221,30 +221,30 @@ select color9 select color9 - + ["<Primary>f"] - toggle font family - toggle font family + switch font family + switch font family - + ["<Primary>w"] - toggle font weight - toggle font weight + switch font weight + switch font weight - + ["<Primary><Shift>w"] - toggle font style - toggle font style + switch font style + switch font style - + ["<Primary><Shift>a"] - toggle text alignment - toggle text alignment + switch text alignment + switch text alignment - + ["<Primary><Shift>i"] - toggle image file - toggle image file + switch image file + switch image file ["<Primary>o"]