[gnome-shell/T29763: 72/249] Used a fixed size for the desktop icons, and don't ever resize them



commit a5ec79ffed60e70571b2abc630de431ba1632a86
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 | 33 ++-------------------------------
 1 file changed, 2 insertions(+), 31 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index c849110373..dbaf262639 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -1,13 +1,12 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 /* exported BaseIcon, IconGrid, PaginatedIconGrid, ANIMATION_MAX_DELAY_OUT_FOR_ITEM */
 
-const { Clutter, GLib, GObject, Graphene, Meta, St } = imports.gi;
+const { Clutter, GObject, Graphene, Meta, St } = imports.gi;
 
 const Params = imports.misc.params;
 const Main = imports.ui.main;
 
-var ICON_SIZE = 96;
-var MIN_ICON_SIZE = 16;
+var ICON_SIZE = 64;
 
 var ANIMATION_TIME_IN = 350;
 var ANIMATION_TIME_OUT = 1 / 2 * ANIMATION_TIME_IN;
@@ -710,34 +709,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]