mirror of https://github.com/PCSX2/pcsx2.git
parent
96f0d65f7d
commit
9dde599e00
|
@ -132,13 +132,14 @@ GameListModel::GameListModel(QObject* parent /* = nullptr */)
|
|||
, m_cover_pixmap_cache(MIN_COVER_CACHE_SIZE)
|
||||
{
|
||||
loadCommonImages();
|
||||
setCoverScale(1.0f);
|
||||
setColumnDisplayNames();
|
||||
}
|
||||
GameListModel::~GameListModel() = default;
|
||||
|
||||
void GameListModel::refreshImages()
|
||||
void GameListModel::reloadThemeSpecificImages()
|
||||
{
|
||||
loadCommonImages();
|
||||
loadThemeSpecificImages();
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
@ -562,20 +563,24 @@ QIcon GameListModel::getIconForRegion(GameList::Region region)
|
|||
QStringLiteral("%1/icons/flags/%2.png").arg(QtHost::GetResourcesBasePath()).arg(GameList::RegionToString(region)));
|
||||
}
|
||||
|
||||
void GameListModel::loadCommonImages()
|
||||
void GameListModel::loadThemeSpecificImages()
|
||||
{
|
||||
for (u32 type = 0; type < static_cast<u32>(GameList::EntryType::Count); type++)
|
||||
m_type_pixmaps[type] = getIconForType(static_cast<GameList::EntryType>(type)).pixmap(QSize(24, 24));
|
||||
|
||||
for (u32 i = 0; i < static_cast<u32>(GameList::Region::Count); i++)
|
||||
m_region_pixmaps[i] = getIconForRegion(static_cast<GameList::Region>(i)).pixmap(QSize(42, 30));
|
||||
}
|
||||
|
||||
void GameListModel::loadCommonImages()
|
||||
{
|
||||
loadThemeSpecificImages();
|
||||
|
||||
const QString base_path(QtHost::GetResourcesBasePath());
|
||||
for (u32 i = 1; i < GameList::CompatibilityRatingCount; i++)
|
||||
m_compatibility_pixmaps[i].load(QStringLiteral("%1/icons/star-%2.png").arg(base_path).arg(i - 1));
|
||||
|
||||
m_placeholder_pixmap.load(QStringLiteral("%1/cover-placeholder.png").arg(base_path));
|
||||
setCoverScale(1.0f);
|
||||
}
|
||||
|
||||
void GameListModel::setColumnDisplayNames()
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
__fi const QString& getColumnDisplayName(int column) { return m_column_display_names[column]; }
|
||||
|
||||
void refresh();
|
||||
void refreshImages();
|
||||
void reloadThemeSpecificImages();
|
||||
|
||||
bool titlesLessThan(int left_row, int right_row) const;
|
||||
|
||||
|
@ -85,6 +85,7 @@ public:
|
|||
|
||||
private:
|
||||
void loadCommonImages();
|
||||
void loadThemeSpecificImages();
|
||||
void setColumnDisplayNames();
|
||||
void loadOrGenerateCover(const GameList::Entry* ge);
|
||||
void invalidateCoverForPath(const std::string& path);
|
||||
|
|
|
@ -260,9 +260,9 @@ void GameListWidget::cancelRefresh()
|
|||
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents, 1);
|
||||
}
|
||||
|
||||
void GameListWidget::refreshImages()
|
||||
void GameListWidget::reloadThemeSpecificImages()
|
||||
{
|
||||
m_model->refreshImages();
|
||||
m_model->reloadThemeSpecificImages();
|
||||
}
|
||||
|
||||
void GameListWidget::onRefreshProgress(const QString& status, int current, int total)
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
|
||||
void refresh(bool invalidate_cache);
|
||||
void cancelRefresh();
|
||||
void refreshImages();
|
||||
void reloadThemeSpecificImages();
|
||||
|
||||
bool isShowingGameList() const;
|
||||
bool isShowingGameGrid() const;
|
||||
|
|
|
@ -1478,7 +1478,7 @@ void MainWindow::onToolsCoverDownloaderTriggered()
|
|||
void MainWindow::updateTheme()
|
||||
{
|
||||
QtHost::UpdateApplicationTheme();
|
||||
m_game_list_widget->refreshImages();
|
||||
m_game_list_widget->reloadThemeSpecificImages();
|
||||
}
|
||||
|
||||
void MainWindow::updateLanguage()
|
||||
|
|
Loading…
Reference in New Issue