Skip to content

Commit

Permalink
Merge pull request #2242 from uklotzde/2.2_track_selected
Browse files Browse the repository at this point in the history
Only highlight crates/playlists when a single track is selected
  • Loading branch information
daschuer authored Sep 28, 2019
2 parents 63fc79c + 9432196 commit 9ebcacb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/widget/wtracktableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,23 @@ void WTrackTableView::slotGuiTick50ms(double /*unused*/) {
mixxx::Duration timeDelta = mixxx::Time::elapsed() - m_lastUserAction;
if (m_loadCachedOnly && timeDelta > mixxx::Duration::fromMillis(100)) {

// Show the currently selected track in the large cover art view. Doing
// this in selectionChanged slows down scrolling performance so we wait
// until the user has stopped interacting first.
// Show the currently selected track in the large cover art view and
// hightlights crate and playlists. Doing this in selectionChanged
// slows down scrolling performance so we wait until the user has
// stopped interacting first.
if (m_selectionChangedSinceLastGuiTick) {
const QModelIndexList indices = selectionModel()->selectedRows();
if (indices.size() > 0 && indices.last().isValid()) {
if (indices.size() == 1 && indices.first().isValid()) {
// A single track has been selected
TrackModel* trackModel = getTrackModel();
if (trackModel) {
TrackPointer pTrack = trackModel->getTrack(indices.last());
TrackPointer pTrack = trackModel->getTrack(indices.first());
if (pTrack) {
emit(trackSelected(pTrack));
}
}
} else {
// None or multiple tracks have been selected
emit(trackSelected(TrackPointer()));
}
m_selectionChangedSinceLastGuiTick = false;
Expand Down

0 comments on commit 9ebcacb

Please sign in to comment.