[gnome-shell/eos3.8: 89/255] iconGrid: Adapt calculation of space between icons and pages



commit bcd414f3386c08b3b8bc3dbf6038baa9cbc1e2bc
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Wed Feb 7 15:44:34 2018 +0000

    iconGrid: Adapt calculation of space between icons and pages
    
    Again, the upstream shell calculates the amount of space between icons
    dynamically depending on the available size of the screen, but we want
    to have a fixed size grid, so let's remove that code to allow
    enforcing our preference from the CSS file.
    
    https://phabricator.endlessm.com/T17658

 data/theme/gnome-shell-sass/_endless.scss |  4 ++++
 js/ui/iconGrid.js                         | 36 +------------------------------
 2 files changed, 5 insertions(+), 35 deletions(-)
---
diff --git a/data/theme/gnome-shell-sass/_endless.scss b/data/theme/gnome-shell-sass/_endless.scss
index 6becdfa9c1..73254c7c71 100644
--- a/data/theme/gnome-shell-sass/_endless.scss
+++ b/data/theme/gnome-shell-sass/_endless.scss
@@ -403,6 +403,10 @@ popup-separator-menu-item {
 }
 
 .icon-grid {
+    spacing: 10px;
+    -shell-grid-horizontal-item-size: 118px;
+    -shell-grid-vertical-item-size: 118px;
+
     .overview-icon {
          @extend %overview-icon;
     }
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index dbaf262639..e9229210c0 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -668,47 +668,13 @@ var IconGrid = GObject.registerClass({
         return this._fixedVItemSize ? this._fixedVItemSize : this._vItemSize;
     }
 
-    _updateSpacingForSize(availWidth, availHeight) {
-        let maxEmptyVArea = availHeight - this._minRows * this._getVItemSize();
-        let maxEmptyHArea = availWidth - this._minColumns * this._getHItemSize();
-        let maxHSpacing, maxVSpacing;
-
-        if (this._padWithSpacing) {
-            // minRows + 1 because we want to put spacing before the first row, so it is like we have one 
more row
-            // to divide the empty space
-            maxVSpacing = Math.floor(maxEmptyVArea / (this._minRows + 1));
-            maxHSpacing = Math.floor(maxEmptyHArea / (this._minColumns + 1));
-        } else {
-            if (this._minRows <=  1)
-                maxVSpacing = maxEmptyVArea;
-            else
-                maxVSpacing = Math.floor(maxEmptyVArea / (this._minRows - 1));
-
-            if (this._minColumns <=  1)
-                maxHSpacing = maxEmptyHArea;
-            else
-                maxHSpacing = Math.floor(maxEmptyHArea / (this._minColumns - 1));
-        }
-
-        let maxSpacing = Math.min(maxHSpacing, maxVSpacing);
-        // Limit spacing to the item size
-        maxSpacing = Math.min(maxSpacing, Math.min(this._getVItemSize(), this._getHItemSize()));
-        // The minimum spacing, regardless of whether it satisfies the row/columng minima,
-        // is the spacing we get from CSS.
-        let spacing = Math.max(this._spacing, maxSpacing);
-        this.setSpacing(spacing);
-        if (this._padWithSpacing)
-            this.topPadding = this.rightPadding = this.bottomPadding = this.leftPadding = spacing;
-    }
-
     /*
      * This function must to be called before iconGrid allocation,
      * to know how much spacing can the grid has
      */
-    adaptToSize(availWidth, availHeight) {
+    adaptToSize() {
         this._fixedHItemSize = this._hItemSize;
         this._fixedVItemSize = this._vItemSize;
-        this._updateSpacingForSize(availWidth, availHeight);
     }
 });
 


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