escape key: leave and erase => leave and hide
This commit is contained in:
parent
91bb4b26a7
commit
3ebcec5a68
3
draw.js
3
draw.js
|
|
@ -168,8 +168,8 @@ var DrawingArea = new Lang.Class({
|
||||||
|
|
||||||
_onKeyPressed: function(actor, event) {
|
_onKeyPressed: function(actor, event) {
|
||||||
if (event.get_key_symbol() == Clutter.Escape) {
|
if (event.get_key_symbol() == Clutter.Escape) {
|
||||||
|
this.hide();
|
||||||
this.emitter.emit('stop-drawing');
|
this.emitter.emit('stop-drawing');
|
||||||
this.erase();
|
|
||||||
return Clutter.EVENT_STOP;
|
return Clutter.EVENT_STOP;
|
||||||
} else if (this.currentElement && this.currentElement.shape == Shapes.TEXT) {
|
} else if (this.currentElement && this.currentElement.shape == Shapes.TEXT) {
|
||||||
if (event.get_key_symbol() == Clutter.KEY_BackSpace) {
|
if (event.get_key_symbol() == Clutter.KEY_BackSpace) {
|
||||||
|
|
@ -460,6 +460,7 @@ var DrawingArea = new Lang.Class({
|
||||||
},
|
},
|
||||||
|
|
||||||
enterDrawingMode: function() {
|
enterDrawingMode: function() {
|
||||||
|
this.show();
|
||||||
this.keyPressedHandler = this.connect('key-press-event', this._onKeyPressed.bind(this));
|
this.keyPressedHandler = this.connect('key-press-event', this._onKeyPressed.bind(this));
|
||||||
this.buttonPressedHandler = this.connect('button-press-event', this._onButtonPressed.bind(this));
|
this.buttonPressedHandler = this.connect('button-press-event', this._onButtonPressed.bind(this));
|
||||||
this.scrollHandler = this.connect('scroll-event', this._onScroll.bind(this));
|
this.scrollHandler = this.connect('scroll-event', this._onScroll.bind(this));
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@ msgstr ""
|
||||||
msgid "Shift key held"
|
msgid "Shift key held"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Leave and erase all drawings"
|
msgid "Leave and hide the drawing"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Escape key"
|
msgid "Escape key"
|
||||||
|
|
|
||||||
2
prefs.js
2
prefs.js
|
|
@ -78,7 +78,7 @@ var OTHER_SHORTCUTS = [
|
||||||
{ desc: "Increment/decrement line width", shortcut: "Scroll" },
|
{ desc: "Increment/decrement line width", shortcut: "Scroll" },
|
||||||
{ desc: "Select color", shortcut: "Ctrl+1...9" },
|
{ desc: "Select color", shortcut: "Ctrl+1...9" },
|
||||||
{ desc: "Select eraser", shortcut: "Shift key held" },
|
{ 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() {
|
function init() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue