[gnome-shell/T27795: 123/138] appDisplay: Allow the folder popup to be shown when there's only one row



commit 0f8aaeedf9da9fa153dc18f95cbc65a96d53e5fd
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Wed Jun 28 11:19:00 2017 +0200

    appDisplay: Allow the folder popup to be shown when there's only one row
    
    When opening the space for a folder popup, the number of rows provided
    is so that at least the folder's icon is still shown when making space
    for the popup. However, if we have only one icon then the popup would
    not be shown.
    
    This patch changes that by allowing the folder icon to be moved out
    if we have only one row (should happen only in very small resolutions).
    
    https://phabricator.endlessm.com/T17840

 js/ui/iconGrid.js | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 2b8f1cc16c..f24d3146cd 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -857,6 +857,13 @@ var PaginatedIconGrid = GObject.registerClass({
         let nRowsAbove = (side == St.Side.TOP) ? sourceRow + 1 : sourceRow;
         let nRowsBelow = this._rowsPerPage - 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
+        // we override that because it's better to move the folder icon out of the
+        // view than not showing the folder popup at all.
+        if (nRows == 0)
+            nRows = 1;
+
         let nRowsUp, nRowsDown;
         if (side == St.Side.TOP) {
             nRowsDown = Math.min(nRowsBelow, nRows);


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