diff options
| author | bunnei <bunneidev@gmail.com> | 2016-05-05 18:35:24 -0400 | 
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2016-05-05 18:35:24 -0400 | 
| commit | 55946cdc119c53656c79667b9a81172563b443ad (patch) | |
| tree | 1fc81259c565ed89e17029a859c06ec8231728aa /src/citra_qt/game_list.cpp | |
| parent | 24d064e8300d19272a2b527687ab889f351d8bf5 (diff) | |
| parent | 9da1534237dfbe72be36200453dc52fce38ae557 (diff) | |
Merge pull request #1700 from wwylele/gamelist-icon
Qt: display game icon and title in the game list
Diffstat (limited to 'src/citra_qt/game_list.cpp')
| -rw-r--r-- | src/citra_qt/game_list.cpp | 16 | 
1 files changed, 13 insertions, 3 deletions
| diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index d14532102..d4ac9c96e 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp @@ -34,8 +34,8 @@ GameList::GameList(QWidget* parent)      tree_view->setUniformRowHeights(true);      item_model->insertColumns(0, COLUMN_COUNT); -    item_model->setHeaderData(COLUMN_FILE_TYPE, Qt::Horizontal, "File type");      item_model->setHeaderData(COLUMN_NAME, Qt::Horizontal, "Name"); +    item_model->setHeaderData(COLUMN_FILE_TYPE, Qt::Horizontal, "File type");      item_model->setHeaderData(COLUMN_SIZE, Qt::Horizontal, "Size");      connect(tree_view, SIGNAL(activated(const QModelIndex&)), this, SLOT(ValidateEntry(const QModelIndex&))); @@ -109,7 +109,11 @@ void GameList::SaveInterfaceLayout()  void GameList::LoadInterfaceLayout()  {      auto header = tree_view->header(); -    header->restoreState(UISettings::values.gamelist_header_state); +    if (!header->restoreState(UISettings::values.gamelist_header_state)) { +        // We are using the name column to display icons and titles +        // so make it as large as possible as default. +        header->resizeSection(COLUMN_NAME, header->width()); +    }      item_model->sort(header->sortIndicatorSection(), header->sortIndicatorOrder());  } @@ -143,9 +147,15 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, bool d                  LOG_WARNING(Frontend, "Filetype and extension of file %s do not match.", physical_name.c_str());              } +            std::vector<u8> smdh; +            std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(FileUtil::IOFile(physical_name, "rb"), filetype, filename_filename, physical_name); + +            if (loader) +                loader->ReadIcon(smdh); +              emit EntryReady({ +                new GameListItemPath(QString::fromStdString(physical_name), smdh),                  new GameListItem(QString::fromStdString(Loader::GetFileTypeString(filetype))), -                new GameListItemPath(QString::fromStdString(physical_name)),                  new GameListItemSize(FileUtil::GetSize(physical_name)),              });          } | 
