[the-board] [things] Deactivate label when Return key is pressed



commit 116bd024fe758ee62cc7d27444a4a98d080b3f8d
Author: Lucas Rocha <lucasr gnome org>
Date:   Wed Mar 9 23:27:58 2011 -0500

    [things] Deactivate label when Return key is pressed
    
    https://bugzilla.gnome.org/show_bug.cgi?id=640596

 src/js/ui/things/text.js |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/js/ui/things/text.js b/src/js/ui/things/text.js
index b68d559..59db216 100644
--- a/src/js/ui/things/text.js
+++ b/src/js/ui/things/text.js
@@ -202,6 +202,9 @@ TextThing.prototype = {
         this._label.clutterText.connect("text-changed",
                                         Lang.bind(this, this._onTextChanged));
 
+        this._label.clutterText.connect("activate",
+                                        Lang.bind(this, this._onTextActivate));
+
         this._textBox.add_actor(this._label, 0);
         this._textBox.get_child_meta(this._label).expand = true;
     },
@@ -300,6 +303,12 @@ TextThing.prototype = {
         Mainloop.idle_add(Lang.bind(this, this._ensureCursorIsVisible));
     },
 
+    _onTextActivate : function(o) {
+        if (this._singleLine) {
+            this.emit("deactivate");
+        }
+    },
+
     activate : function() {
         if (this._editable) {
             this._label.clutterText.editable = true;



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