Skip to content

Commit

Permalink
RMW: Fix Track creation order
Browse files Browse the repository at this point in the history
Bug #1670
  • Loading branch information
tedfelix committed Apr 4, 2024
1 parent 046fe23 commit 2a7141e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/gui/application/RosegardenMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3879,6 +3879,19 @@ RosegardenMainWindow::slotAddTrack()
pos = track->getPosition() + 1;

m_view->addTrack(foundInstrumentID, pos);

// Move the selected Track to the new Track so that repeated pressings
// of Ctrl+T yields a series of new Tracks in correct Instrument order.
TrackId newTrackID = comp.getTrackByPosition(pos)->getId();
comp.setSelectedTrack(newTrackID);
comp.notifyTrackSelectionChanged(newTrackID);
// Note that we don't call m_view->slotSelectTrackSegments(newTrackId)
// because there are no segments on this new track, so there is no point.
// Track selection and Segment selection might get out of sync. Not
// sure if that is a problem.
//m_view->slotSelectTrackSegments(newTrackId);
RosegardenDocument::currentDocument->emitDocumentModified();

}

void
Expand Down

0 comments on commit 2a7141e

Please sign in to comment.