hide help on `Escape` key pressed

Press the key again to leave drawing mode.
This commit is contained in:
abakkk 2020-06-05 22:52:02 +02:00
parent 0249d12694
commit c087e359d9
1 changed files with 4 additions and 1 deletions

View File

@ -297,7 +297,10 @@ var DrawingArea = new Lang.Class({
_onKeyPressed: function(actor, event) {
if (event.get_key_symbol() == Clutter.KEY_Escape) {
this.emit('stop-drawing');
if (this.helper.visible)
this.helper.hideHelp();
else
this.emit('stop-drawing');
return Clutter.EVENT_STOP;
} else if (this.currentElement && this.currentElement.shape == Shapes.TEXT && this.currentElement.state == TextState.WRITING) {