From 3ebcec5a68c15a7a6fff4475015b7fcbd88bcb5d Mon Sep 17 00:00:00 2001 From: abakkk Date: Fri, 8 Mar 2019 12:41:38 +0100 Subject: [PATCH] escape key: leave and erase => leave and hide --- draw.js | 3 ++- locale/draw-on-your-screen.pot | 2 +- prefs.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/draw.js b/draw.js index 600ef6b..cb86da6 100644 --- a/draw.js +++ b/draw.js @@ -168,8 +168,8 @@ var DrawingArea = new Lang.Class({ _onKeyPressed: function(actor, event) { if (event.get_key_symbol() == Clutter.Escape) { + this.hide(); this.emitter.emit('stop-drawing'); - this.erase(); return Clutter.EVENT_STOP; } else if (this.currentElement && this.currentElement.shape == Shapes.TEXT) { if (event.get_key_symbol() == Clutter.KEY_BackSpace) { @@ -460,6 +460,7 @@ var DrawingArea = new Lang.Class({ }, enterDrawingMode: function() { + this.show(); this.keyPressedHandler = this.connect('key-press-event', this._onKeyPressed.bind(this)); this.buttonPressedHandler = this.connect('button-press-event', this._onButtonPressed.bind(this)); this.scrollHandler = this.connect('scroll-event', this._onScroll.bind(this)); diff --git a/locale/draw-on-your-screen.pot b/locale/draw-on-your-screen.pot index 025787a..6578ed6 100644 --- a/locale/draw-on-your-screen.pot +++ b/locale/draw-on-your-screen.pot @@ -201,7 +201,7 @@ msgstr "" msgid "Shift key held" msgstr "" -msgid "Leave and erase all drawings" +msgid "Leave and hide the drawing" msgstr "" msgid "Escape key" diff --git a/prefs.js b/prefs.js index 38509d0..6593337 100644 --- a/prefs.js +++ b/prefs.js @@ -78,7 +78,7 @@ var OTHER_SHORTCUTS = [ { desc: "Increment/decrement line width", shortcut: "Scroll" }, { desc: "Select color", shortcut: "Ctrl+1...9" }, { desc: "Select eraser", shortcut: "Shift key held" }, - { desc: "Leave and erase all drawings", shortcut: "Escape key" } + { desc: "Leave and hide the drawing", shortcut: "Escape key" } ]; function init() {