Small fix to the populateList function of the GridGameListView

- Call the addPlaceholder function if grid is empty
- Set the header text
This commit is contained in:
Koerty 2018-03-31 16:01:18 +02:00
parent 560ca045cd
commit 96b1f4b514

View file

@ -38,9 +38,17 @@ bool GridGameListView::input(InputConfig* config, Input input)
void GridGameListView::populateList(const std::vector<FileData*>& files)
{
mGrid.clear();
for(auto it = files.cbegin(); it != files.cend(); it++)
mHeaderText.setText(mRoot->getSystem()->getFullName());
if (files.size() > 0)
{
mGrid.add((*it)->getName(), (*it)->getThumbnailPath(), *it);
for (auto it = files.cbegin(); it != files.cend(); it++)
{
mGrid.add((*it)->getName(), (*it)->getThumbnailPath(), *it);
}
}
else
{
addPlaceholder();
}
}