[gnome-shell/T27795: 87/138] Used a fixed size for the desktop icons, and don't ever resize them



commit d4b072ccdf33aa3e462a3252c94e890cb65c9d01
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Thu Jun 15 15:02:51 2017 -0700

    Used a fixed size for the desktop icons, and don't ever resize them
    
    Upstream adapts the icons to the size of the screen, which is different
    from the fixed size layout we use in Endless, so don't do that here.

 js/ui/iconGrid.js | 29 +----------------------------
 1 file changed, 1 insertion(+), 28 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index ecc7b559d5..917a1e54bc 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -6,7 +6,7 @@ const { Clutter, GLib, GObject, Meta, St } = imports.gi;
 const Params = imports.misc.params;
 const Main = imports.ui.main;
 
-var ICON_SIZE = 96;
+var ICON_SIZE = 64;
 var MIN_ICON_SIZE = 16;
 
 var EXTRA_SPACE_ANIMATION_TIME = 250;
@@ -689,33 +689,6 @@ var IconGrid = GObject.registerClass({
         this._fixedHItemSize = this._hItemSize;
         this._fixedVItemSize = this._vItemSize;
         this._updateSpacingForSize(availWidth, availHeight);
-
-        if (this.columnsForWidth(availWidth) < this._minColumns || this.rowsForHeight(availHeight) < 
this._minRows) {
-            let neededWidth = this.usedWidthForNColumns(this._minColumns) - availWidth;
-            let neededHeight = this.usedHeightForNRows(this._minRows) - availHeight;
-
-            let neededSpacePerItem = (neededWidth > neededHeight)
-                ? Math.ceil(neededWidth / this._minColumns)
-                : Math.ceil(neededHeight / this._minRows);
-            this._fixedHItemSize = Math.max(this._hItemSize - neededSpacePerItem, MIN_ICON_SIZE);
-            this._fixedVItemSize = Math.max(this._vItemSize - neededSpacePerItem, MIN_ICON_SIZE);
-
-            this._updateSpacingForSize(availWidth, availHeight);
-        }
-        if (!this._updateIconSizesLaterId)
-            this._updateIconSizesLaterId = Meta.later_add(Meta.LaterType.BEFORE_REDRAW,
-                                                          this._updateIconSizes.bind(this));
-    }
-
-    // Note that this is ICON_SIZE as used by BaseIcon, not elsewhere in IconGrid; it's a bit messed up
-    _updateIconSizes() {
-        this._updateIconSizesLaterId = 0;
-        let scale = Math.min(this._fixedHItemSize, this._fixedVItemSize) / Math.max(this._hItemSize, 
this._vItemSize);
-        let newIconSize = Math.floor(ICON_SIZE * scale);
-        for (let i in this._items) {
-            this._items[i].icon.setIconSize(newIconSize);
-        }
-        return GLib.SOURCE_REMOVE;
     }
 });
 


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