mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-09 16:04:33 +00:00
Qt: Avoid a full reset when toggling show cover titles / localized titles
This commit is contained in:
committed by
Connor McLaughlin
parent
6765b2feb0
commit
d499d8e2d8
@@ -152,11 +152,19 @@ void GameListModel::setShowLocalizedTitles(bool enabled)
|
||||
{
|
||||
m_show_localized_titles = enabled;
|
||||
|
||||
emit dataChanged(index(0, Column_Title), index(rowCount() - 1, Column_Title), {Qt::DisplayRole});
|
||||
emit dataChanged(index(0, Column_Title), index(rowCount() - 1, Column_Title), {Qt::DisplayRole, Qt::ToolTipRole});
|
||||
if (m_show_titles_for_covers)
|
||||
emit dataChanged(index(0, Column_Cover), index(rowCount() - 1, Column_Cover), {Qt::DisplayRole});
|
||||
// emit cover changed as well since the autogenerated covers will differ
|
||||
refreshCovers();
|
||||
}
|
||||
|
||||
void GameListModel::setShowCoverTitles(bool enabled)
|
||||
{
|
||||
m_show_titles_for_covers = enabled;
|
||||
emit dataChanged(index(0, Column_Cover), index(rowCount() - 1, Column_Cover), {Qt::DisplayRole});
|
||||
}
|
||||
|
||||
void GameListModel::setShowGameIcons(bool enabled)
|
||||
{
|
||||
m_show_game_icons = enabled;
|
||||
@@ -244,7 +252,7 @@ void GameListModel::updateCoverScale()
|
||||
void GameListModel::refreshCovers()
|
||||
{
|
||||
m_cover_pixmap_cache.Clear();
|
||||
emit dataChanged(index(0, Column_Cover), index(rowCount() - 1, Column_Cover), {Qt::DisplayRole});
|
||||
emit dataChanged(index(0, Column_Cover), index(rowCount() - 1, Column_Cover), {Qt::DecorationRole});
|
||||
}
|
||||
|
||||
void GameListModel::updateCacheSize(int num_rows, int num_columns)
|
||||
@@ -1598,8 +1606,6 @@ void GameListWidget::setShowLocalizedTitles(bool enabled)
|
||||
Host::SetBaseBoolSettingValue("UI", "GameListShowLocalizedTitles", enabled);
|
||||
Host::CommitBaseSettingChanges();
|
||||
m_model->setShowLocalizedTitles(enabled);
|
||||
if (isShowingGameGrid())
|
||||
m_model->refresh();
|
||||
}
|
||||
|
||||
void GameListWidget::setShowGameIcons(bool enabled)
|
||||
@@ -1621,8 +1627,6 @@ void GameListWidget::setShowCoverTitles(bool enabled)
|
||||
Host::CommitBaseSettingChanges();
|
||||
m_model->setShowCoverTitles(enabled);
|
||||
m_grid_view->updateLayout();
|
||||
if (isShowingGameGrid())
|
||||
m_model->refresh();
|
||||
}
|
||||
|
||||
void GameListWidget::updateView(bool grid_view)
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
void setShowLocalizedTitles(bool enabled);
|
||||
|
||||
bool getShowCoverTitles() const { return m_show_titles_for_covers; }
|
||||
void setShowCoverTitles(bool enabled) { m_show_titles_for_covers = enabled; }
|
||||
void setShowCoverTitles(bool enabled);
|
||||
|
||||
float getIconScale() const { return m_icon_scale; }
|
||||
void setIconScale(float scale);
|
||||
|
||||
Reference in New Issue
Block a user