From 2d24230a48b38d5e8bf2b7da2998ca3901dc0926 Mon Sep 17 00:00:00 2001
From: Leon Styhre <leon@leonstyhre.com>
Date: Wed, 7 Dec 2022 21:23:53 +0100
Subject: [PATCH] Fixed an issue where the GridComponent layout was not
 calculated if there was only a placeholder entry.

---
 es-app/src/views/GamelistBase.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/es-app/src/views/GamelistBase.cpp b/es-app/src/views/GamelistBase.cpp
index c4f364e9b..1af535474 100644
--- a/es-app/src/views/GamelistBase.cpp
+++ b/es-app/src/views/GamelistBase.cpp
@@ -707,13 +707,14 @@ void GamelistBase::populateList(const std::vector<FileData*>& files, FileData* f
                 mTextList->addEntry(textListEntry);
             }
         }
-        if (mGrid != nullptr)
-            mGrid->calculateLayout();
     }
     else {
         addPlaceholder(firstEntry);
     }
 
+    if (mGrid != nullptr)
+        mGrid->calculateLayout();
+
     generateGamelistInfo(getCursor(), firstEntry);
     generateFirstLetterIndex(files);
 }