[gnome-shell/T27795: 124/138] folders: Fix displaying folders' popups



commit 76dc491b616f5c47226e84482ea51db73f1a5876
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Thu Jun 29 22:09:26 2017 +0200

    folders: Fix displaying folders' popups
    
    The space calculated for the folders' popups was previously based on
    the number of icon rows currently being displayed. This is obviously
    very limiting because we can have one single row of icons where much
    more fit it, and this would prevent the folder's popups and icons
    from being correctly shown.
    
    This patch fixes that by using the number of possible rows in a page
    instead, which ensures that the grid will only move icons when needed
    and results in a much better use of the space available.
    
    https://phabricator.endlessm.com/T17840

 js/ui/iconGrid.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index f24d3146cd..d671593c5e 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -708,6 +708,7 @@ var PaginatedIconGrid = GObject.registerClass({
         this._rowsPerPage = 0;
         this._spaceBetweenPages = 0;
         this._childrenPerPage = 0;
+        this._maxRowsPerPage = 0;
     }
 
     vfunc_get_preferred_height(_forWidth) {
@@ -798,6 +799,7 @@ var PaginatedIconGrid = GObject.registerClass({
             this._spaceBetweenPages = this._getSpacing();
 
         this._childrenPerPage = nColumns * this._rowsPerPage;
+        this._maxRowsPerPage = this.rowsForHeight(availHeightPerPage);
     }
 
     adaptToSize(availWidth, availHeight) {
@@ -855,7 +857,7 @@ var PaginatedIconGrid = GObject.registerClass({
         let sourceRow = Math.floor((index - pageOffset) / childrenPerRow);
 
         let nRowsAbove = (side == St.Side.TOP) ? sourceRow + 1 : sourceRow;
-        let nRowsBelow = this._rowsPerPage - nRowsAbove;
+        let nRowsBelow = this._maxRowsPerPage - nRowsAbove;
 
         // Since it always tries to show up the folder icon, then when only 1 row is
         // being displayed, the number of rows (to be moved out) here is 0; however


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