[gnome-shell/gnome-3-38] iconGrid/iconGridLayout: Simplify _findBestIconSize()
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-38] iconGrid/iconGridLayout: Simplify _findBestIconSize()
- Date: Wed, 2 Dec 2020 23:03:51 +0000 (UTC)
commit 4b64808d523c1d06d1d42792a9565b3506dacd49
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Dec 1 17:58:09 2020 -0300
iconGrid/iconGridLayout: Simplify _findBestIconSize()
The 'bestSize' variable isn't necessary anymore, remove it in favor of
simply returning the 'size' or, if no suitable size found, IconSize.TINY.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1518>
(cherry picked from commit b120b17d01f91c9672f81585ca95fcdd6d4c47ea)
js/ui/iconGrid.js | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index c467d80f74..4d7f4333a8 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -399,7 +399,6 @@ var IconGridLayout = GObject.registerClass({
if (this._fixedIconSize !== -1)
return this._fixedIconSize;
- let bestSize;
const iconSizes = Object.values(IconSize).sort((a, b) => b - a);
for (const size of iconSizes) {
let usedWidth, usedHeight;
@@ -425,13 +424,11 @@ var IconGridLayout = GObject.registerClass({
this._pageHeight - usedHeight - rowSpacingPerPage -
this._pagePadding.top - this._pagePadding.bottom;
- bestSize = size;
-
if (emptyHSpace >= 0 && emptyVSpace > 0)
- break;
+ return size;
}
- return bestSize;
+ return IconSize.TINY;
}
_getChildrenMaxSize() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]