gnome-shell r89 - trunk/js/ui



Author: walters
Date: Fri Nov 28 20:48:38 2008
New Revision: 89
URL: http://svn.gnome.org/viewvc/gnome-shell?rev=89&view=rev

Log:
Bug 562604 - Close the Run Dialog when Escape is pressed

Patch from RainCT (Siegfried Gevatter).

Modified:
   trunk/js/ui/run_dialog.js

Modified: trunk/js/ui/run_dialog.js
==============================================================================
--- trunk/js/ui/run_dialog.js	(original)
+++ trunk/js/ui/run_dialog.js	Fri Nov 28 20:48:38 2008
@@ -92,6 +92,7 @@
 },
 
 show : function() {
+    let me = this;
     if (this._group.visible) // Already shown
         return false;
 
@@ -100,16 +101,14 @@
 
     this._group.show_all();
 
-    // TODO: Detect escape key and make it cancel the operation.
-    //       Use me.on_cancel() if it exists. Something like this:
-    // this._entry.connect('key-press-event', function(o, e) {
-    //     if (the pressed key is the escape key) {
-    //         me.hide();
-    //         me.emit('cancel');
-    //         return false;
-    //     } else
-    //         return true;
-    // });
+    this._entry.connect('key-press-event', function(o, e) {
+        if (e.get_code() == 9) {
+            me.hide();
+            me.emit('cancel');
+            return true;
+        } else
+            return false;
+    });
 
     let global = Shell.Global.get();
     global.stage.set_key_focus(this._entry);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]