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