[gnome-shell] iconGrid: Exclude hidden children from the layout



commit dafaab66b171dadb276928b9174e7f553cfc2f21
Author: Maxim Ermilov <zaspire rambler ru>
Date:   Sat Dec 18 22:09:58 2010 +0300

    iconGrid: Exclude hidden children from the layout
    
    As all children were considered for the grid's layout, hidden items showed up as
    empty space. Instead, exclude hidden children from the layout, so that the grid is
    only made up of visible items.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=631537

 js/ui/iconGrid.js |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index ff6a60b..e8ac3ac 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -165,8 +165,16 @@ IconGrid.prototype = {
         alloc.natural_size = nColumns * this._item_size + totalSpacing;
     },
 
-    _getPreferredHeight: function (grid, forWidth, alloc) {
+    _getVisibleChildren: function() {
         let children = this._grid.get_children();
+        children = children.filter(function(actor) {
+            return actor.visible;
+        });
+        return children;
+    },
+
+    _getPreferredHeight: function (grid, forWidth, alloc) {
+        let children = this._getVisibleChildren();
         let [nColumns, usedWidth] = this._computeLayout(forWidth);
         let nRows;
         if (nColumns > 0)
@@ -182,7 +190,7 @@ IconGrid.prototype = {
     },
 
     _allocate: function (grid, box, flags) {
-        let children = this._grid.get_children();
+        let children = this._getVisibleChildren();
         let availWidth = box.x2 - box.x1;
         let availHeight = box.y2 - box.y1;
 



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