1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 19:31:02 +01:00

Select the entire row when scrolling to the currently playing item.

This commit is contained in:
David Sansome 2010-05-18 18:19:19 +00:00
parent af3f8bcdfe
commit 63c2640032

View File

@ -379,8 +379,16 @@ void PlaylistView::JumpToCurrentlyPlayingTrack() {
QModelIndex current = playlist->index(playlist->current_index(), 0);
currently_autoscrolling_ = true;
// Scroll to the item
scrollTo(current, QAbstractItemView::PositionAtCenter);
selectionModel()->setCurrentIndex(current, QItemSelectionModel::ClearAndSelect);
// Replace the selection.
// We have to get the whole row here, not just the current cell.
selectionModel()->select(current,
QItemSelectionModel::Clear | QItemSelectionModel::Select |
QItemSelectionModel::Current | QItemSelectionModel::Rows);
currently_autoscrolling_ = false;
}