Skip to content

Commit e91db67

Browse files
authored
Qt: Reload icons and tooltips when game list rows change (#3609)
1 parent 520502d commit e91db67

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/core/game_list.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ void GameList::AddPlayedTimeForSerial(const std::string& serial, std::time_t las
15061506
}
15071507

15081508
if (!changed_indices.empty())
1509-
Host::OnGameListEntriesChanged(std::span<const u32>(changed_indices.begin(), changed_indices.end()));
1509+
Host::OnGameListEntriesChanged(changed_indices);
15101510
}
15111511

15121512
void GameList::ClearPlayedTimeForSerial(const std::string& serial)

src/duckstation-qt/gamelistwidget.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ void GameListModel::coverLoaded(const std::string& path, const QImage& image, fl
476476

477477
void GameListModel::rowsChanged(const QList<int>& rows)
478478
{
479-
const QList<int> roles_changed = {Qt::DisplayRole};
479+
QList<int> roles_changed{Qt::DisplayRole, Qt::ToolTipRole};
480+
if (m_show_game_icons)
481+
roles_changed.append(Qt::DecorationRole);
480482

481483
// try to collapse multiples
482484
size_t start = 0;
@@ -1526,8 +1528,8 @@ class GameListAnimatedIconDelegate final : public QStyledItemDelegate
15261528
m_animation_timer.stop();
15271529
}
15281530

1529-
emit m_model->dataChanged(m_model->index(m_source_row, GameListModel::Column_Icon),
1530-
m_model->index(m_source_row, GameListModel::Column_Icon), {Qt::DecorationRole});
1531+
const QModelIndex mi = m_model->index(m_source_row, GameListModel::Column_Icon);
1532+
emit m_model->dataChanged(mi, mi, {Qt::DecorationRole});
15311533
}
15321534

15331535
void pauseAnimation()

0 commit comments

Comments
 (0)