[gnome-shell] iconGrid: Add a key-focus-in signal



commit 8d8c75d32dd59f3cc434e9ef6a0d0579eb3f8037
Author: Rui Matos <tiagomatos gmail com>
Date:   Thu Mar 20 14:48:58 2014 +0100

    iconGrid: Add a key-focus-in signal
    
    This fires whenever a grid's child emits its own key-focus-in signal.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726759

 js/ui/iconGrid.js |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 51fba64..6bbbcb7 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -214,6 +214,20 @@ const IconGrid = new Lang.Class({
         this._grid.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
         this._grid.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
         this._grid.connect('allocate', Lang.bind(this, this._allocate));
+        this._grid.connect('actor-added', Lang.bind(this, this._childAdded));
+        this._grid.connect('actor-removed', Lang.bind(this, this._childRemoved));
+    },
+
+    _keyFocusIn: function(actor) {
+        this.emit('key-focus-in', actor);
+    },
+
+    _childAdded: function(grid, child) {
+        child._iconGridKeyFocusInId = child.connect('key-focus-in', Lang.bind(this, this._keyFocusIn));
+    },
+
+    _childRemoved: function(grid, child) {
+        child.disconnect(child._iconGridKeyFocusInId);
     },
 
     _getPreferredWidth: function (grid, forHeight, alloc) {
@@ -527,6 +541,7 @@ const IconGrid = new Lang.Class({
         }
     }
 });
+Signals.addSignalMethods(IconGrid.prototype);
 
 const PaginatedIconGrid = new Lang.Class({
     Name: 'PaginatedIconGrid',


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