Skip to content

Commit

Permalink
Merge pull request #886 from oxygen-dioxide/selection
Browse files Browse the repository at this point in the history
ctrl-click to add note into selection without deselecting the other notes
  • Loading branch information
stakira authored Oct 20, 2023
2 parents 3e079fa + d6215bd commit 1773296
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion OpenUtau/ViewModels/NotesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -511,17 +511,24 @@ public void DeselectNotes() {
}

public void ToggleSelectNote(UNote note) {
/// <summary>
/// Change the selection state of a note without affecting the selection state of the other notes.
/// Add it to selection if it isn't selected, or deselect it if it is already selected.
/// </summary>
if (Part == null) {
return;
}
if (Selection.Contains(note)) {
DeselectNote(note);
} else {
SelectNote(note);
SelectNote(note, false);
}
}

public void SelectNote(UNote note) {
/// <summary>
/// Select a note and deselect all the other notes.
/// </summary>
SelectNote(note, true);
}
public void SelectNote(UNote note, bool deselectExisting) {
Expand Down

0 comments on commit 1773296

Please sign in to comment.