Bug 562604 - Close the Run Dialog when Escape is pressed
Patch from RainCT (Siegfried Gevatter). svn path=/trunk/; revision=89
This commit is contained in:
parent
6cc571b41e
commit
fae6839eb8
@ -92,6 +92,7 @@ _run : function(command) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
show : function() {
|
show : function() {
|
||||||
|
let me = this;
|
||||||
if (this._group.visible) // Already shown
|
if (this._group.visible) // Already shown
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -100,16 +101,14 @@ show : function() {
|
|||||||
|
|
||||||
this._group.show_all();
|
this._group.show_all();
|
||||||
|
|
||||||
// TODO: Detect escape key and make it cancel the operation.
|
this._entry.connect('key-press-event', function(o, e) {
|
||||||
// Use me.on_cancel() if it exists. Something like this:
|
if (e.get_code() == 9) {
|
||||||
// this._entry.connect('key-press-event', function(o, e) {
|
me.hide();
|
||||||
// if (the pressed key is the escape key) {
|
me.emit('cancel');
|
||||||
// me.hide();
|
return true;
|
||||||
// me.emit('cancel');
|
} else
|
||||||
// return false;
|
return false;
|
||||||
// } else
|
});
|
||||||
// return true;
|
|
||||||
// });
|
|
||||||
|
|
||||||
let global = Shell.Global.get();
|
let global = Shell.Global.get();
|
||||||
global.stage.set_key_focus(this._entry);
|
global.stage.set_key_focus(this._entry);
|
||||||
|
Loading…
Reference in New Issue
Block a user