diff --git a/draw.js b/draw.js index fa5ca6f..f2e52b0 100644 --- a/draw.js +++ b/draw.js @@ -170,13 +170,11 @@ var DrawingArea = new Lang.Class({ } if (button == 1) { - this._startDrawing(x, y, false, shiftPressed); + this._startDrawing(x, y, shiftPressed); return Clutter.EVENT_STOP; } else if (button == 2) { this.toggleShape(); } else if (button == 3) { - /*this._startDrawing(x, y, true, shiftPressed); - return Clutter.EVENT_STOP;*/ this.menu.open(x, y); return Clutter.EVENT_STOP; } @@ -231,7 +229,7 @@ var DrawingArea = new Lang.Class({ return Clutter.EVENT_STOP; }, - _startDrawing: function(stageX, stageY, fill, eraser) { + _startDrawing: function(stageX, stageY, eraser) { let [success, startX, startY] = this.transform_stage_point(stageX, stageY); if (!success) @@ -248,7 +246,7 @@ var DrawingArea = new Lang.Class({ color: this.currentColor.to_string(), line: { lineWidth: this.currentLineWidth, lineJoin: this.currentLineJoin, lineCap: this.currentLineCap }, dash: { array: this.dashedLine ? this.dashArray : [0, 0] , offset: this.dashedLine ? this.dashOffset : 0 }, - fill: fill, + fill: this.fill, eraser: eraser, transform: { active: false, center: [0, 0], angle: 0, startAngle: 0, ratio: 1 }, text: '', @@ -424,6 +422,11 @@ var DrawingArea = new Lang.Class({ this.selectShape((this.currentShape == Object.keys(Shapes).length - 1) ? 0 : this.currentShape + 1); }, + toggleFill: function() { + this.fill = !this.fill; + this.emitter.emit('show-osd', this.fill ? _("Fill") : _("Stroke"), null); + }, + toggleDash: function() { this.dashedLine = !this.dashedLine; this.emitter.emit('show-osd', this.dashedLine ? _("Dashed line") : _("Full line"), null); diff --git a/extension.js b/extension.js index 6ff4f77..176c37d 100644 --- a/extension.js +++ b/extension.js @@ -150,6 +150,7 @@ var AreaManager = new Lang.Class({ 'toggle-linejoin': this.activeArea.toggleLineJoin.bind(this.activeArea), 'toggle-linecap': this.activeArea.toggleLineCap.bind(this.activeArea), 'toggle-dash' : this.activeArea.toggleDash.bind(this.activeArea), + 'toggle-fill' : this.activeArea.toggleFill.bind(this.activeArea), 'select-none-shape': () => this.activeArea.selectShape(Draw.Shapes.NONE), 'select-line-shape': () => this.activeArea.selectShape(Draw.Shapes.LINE), 'select-ellipse-shape': () => this.activeArea.selectShape(Draw.Shapes.ELLIPSE), diff --git a/locale/draw-on-your-screen.pot b/locale/draw-on-your-screen.pot index 47f3a3c..a9615d9 100644 --- a/locale/draw-on-your-screen.pot +++ b/locale/draw-on-your-screen.pot @@ -43,6 +43,12 @@ msgstr "" msgid "Text" msgstr "" +msgid "Fill" +msgstr "" + +msgid "Stroke" +msgstr "" + msgid "Dashed line" msgstr "" @@ -81,9 +87,6 @@ msgstr "" msgid "Smooth" msgstr "" -msgid "Fill" -msgstr "" - msgid "Dashed" msgstr "" @@ -148,6 +151,9 @@ msgstr "" msgid "Unselect shape (free drawing)" msgstr "" +msgid "Select fill/stroke" +msgstr "" + msgid "Change font family (generic name)" msgstr "" diff --git a/prefs.js b/prefs.js index adca46c..643bfe7 100644 --- a/prefs.js +++ b/prefs.js @@ -56,6 +56,7 @@ var INTERNAL_KEYBINDINGS = { 'select-rectangle-shape': "Select rectangle", 'select-text-shape': "Select text", 'select-none-shape': "Unselect shape (free drawing)", + 'toggle-fill': "Select fill/stroke", '-separator-3': '', 'toggle-font-family': "Change font family (generic name)", 'toggle-font-weight': "Change font weight", diff --git a/schemas/gschemas.compiled b/schemas/gschemas.compiled index dfce124..6645b28 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 57c0d1c..770e394 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 @@ -117,10 +117,15 @@ toggle linecap - ["<Primary>a"] + ["<Primary>period"] toggle dash toggle dash + + ["<Primary>a"] + toggle fill + toggle fill + KP_1','1']]]> select color1