[gnome-shell/wip/swarm: 6/6] iconGrid: Move code around a bit
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/swarm: 6/6] iconGrid: Move code around a bit
- Date: Tue, 19 Aug 2014 17:32:06 +0000 (UTC)
commit c0f50a9f09cf1fff3b5c62e7f783c4081dd33f0a
Author: Florian Müllner <fmuellner gnome org>
Date: Sun Aug 17 19:44:52 2014 +0200
iconGrid: Move code around a bit
The scale passed to _updateChildrenScale is exclusively computed from
properties, so it can be moved into the function itself - as the scale
now becomes a mere detail, rename to a more appropriate _updateIconSizes
at the same time.
js/ui/iconGrid.js | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 6258579..4135d63 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -779,12 +779,13 @@ const IconGrid = new Lang.Class({
this._updateSpacingForSize(availWidth, availHeight);
}
- let scale = Math.min(this._fixedHItemSize, this._fixedVItemSize) / Math.max(this._hItemSize,
this._vItemSize);
- Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
this._updateChildrenScale(scale); }));
+ Meta.later_add(Meta.LaterType.BEFORE_REDRAW,
+ Lang.bind(this, this._updateIconSizes));
},
// Note that this is ICON_SIZE as used by BaseIcon, not elsewhere in IconGrid; it's a bit messed up
- _updateChildrenScale: function(scale) {
+ _updateIconSizes: function() {
+ 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]