From b115e07b4a73fe6f3435b239fd0d1e5e1aac4026 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 9 Jun 2022 15:40:21 -0300 Subject: [PATCH] iconGrid: Always call findBestModeForSize() The API surface of IconGrid was originally meant to be only setGridModes(), however findBestModeForSize() ended up being called by AppDisplay code. Now that FolderGrid sets the modes correctly, we don't need to skip calling findBestModeForSize() anymore. Always call findBestModeForSize() during IconGrid's allocation. Add an underscore to findBestModeForSize() since it's now back to be a private method of IconGrid. Part-of: --- js/ui/iconGrid.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index a5f86fc64..ac8d3ecaa 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -1180,7 +1180,7 @@ var IconGrid = GObject.registerClass({ } } - findBestModeForSize(width, height) { + _findBestModeForSize(width, height) { const { pagePadding } = this.layout_manager; width -= pagePadding.left + pagePadding.right; height -= pagePadding.top + pagePadding.bottom; @@ -1208,7 +1208,9 @@ var IconGrid = GObject.registerClass({ } vfunc_allocate(box) { - this.layout_manager.adaptToSize(...box.get_size()); + const [width, height] = box.get_size(); + this._findBestModeForSize(width, height); + this.layout_manager.adaptToSize(width, height); super.vfunc_allocate(box); }