mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-02-17 03:15:39 +00:00
Qt: Support changing theme without reopening window
This commit is contained in:
parent
bc49e2f627
commit
5510f66a12
|
@ -146,6 +146,12 @@ void GameListModel::updateCacheSize(int width, int height)
|
||||||
m_cover_pixmap_cache.SetMaxCapacity(static_cast<int>(std::max(num_columns * num_rows, MIN_COVER_CACHE_SIZE)));
|
m_cover_pixmap_cache.SetMaxCapacity(static_cast<int>(std::max(num_columns * num_rows, MIN_COVER_CACHE_SIZE)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GameListModel::reloadCommonImages()
|
||||||
|
{
|
||||||
|
loadCommonImages();
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
|
||||||
void GameListModel::loadOrGenerateCover(const GameList::Entry* ge)
|
void GameListModel::loadOrGenerateCover(const GameList::Entry* ge)
|
||||||
{
|
{
|
||||||
QFuture<QPixmap> future =
|
QFuture<QPixmap> future =
|
||||||
|
|
|
@ -63,6 +63,7 @@ public:
|
||||||
int getCoverArtSpacing() const;
|
int getCoverArtSpacing() const;
|
||||||
void refreshCovers();
|
void refreshCovers();
|
||||||
void updateCacheSize(int width, int height);
|
void updateCacheSize(int width, int height);
|
||||||
|
void reloadCommonImages();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void loadCommonImages();
|
void loadCommonImages();
|
||||||
|
|
|
@ -455,6 +455,11 @@ void GameListWidget::resizeTableViewColumnsToFit()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GameListWidget::reloadCommonImages()
|
||||||
|
{
|
||||||
|
m_model->reloadCommonImages();
|
||||||
|
}
|
||||||
|
|
||||||
static TinyString getColumnVisibilitySettingsKeyName(int column)
|
static TinyString getColumnVisibilitySettingsKeyName(int column)
|
||||||
{
|
{
|
||||||
return TinyString::FromFormat("Show%s", GameListModel::getColumnName(static_cast<GameListModel::Column>(column)));
|
return TinyString::FromFormat("Show%s", GameListModel::getColumnName(static_cast<GameListModel::Column>(column)));
|
||||||
|
|
|
@ -38,6 +38,7 @@ public:
|
||||||
|
|
||||||
void initialize();
|
void initialize();
|
||||||
void resizeTableViewColumnsToFit();
|
void resizeTableViewColumnsToFit();
|
||||||
|
void reloadCommonImages();
|
||||||
|
|
||||||
void refresh(bool invalidate_cache);
|
void refresh(bool invalidate_cache);
|
||||||
void cancelRefresh();
|
void cancelRefresh();
|
||||||
|
|
|
@ -1957,9 +1957,8 @@ void MainWindow::setTheme(const QString& theme)
|
||||||
{
|
{
|
||||||
Host::SetBaseStringSettingValue("UI", "Theme", theme.toUtf8().constData());
|
Host::SetBaseStringSettingValue("UI", "Theme", theme.toUtf8().constData());
|
||||||
updateApplicationTheme();
|
updateApplicationTheme();
|
||||||
|
updateMenuSelectedTheme();
|
||||||
// Sadly we need to recreate here, because otherwise the icon theme doesn't update.
|
m_game_list_widget->reloadCommonImages();
|
||||||
recreate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::setStyleFromSettings()
|
void MainWindow::setStyleFromSettings()
|
||||||
|
|
Loading…
Reference in a new issue