Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #297423: allow ctrl+click to modify range selection #6139

Merged
merged 1 commit into from
Jun 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mscore/events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,11 @@ void ScoreView::mousePressEventNormal(QMouseEvent* ev)
}
else {
if (st == SelectType::ADD) {
// convert range to list
if (e->score()->selection().isRange()) {
e->score()->selection().setState(SelState::LIST);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has an effect on all operations acting differently on the selection being a list or a range, e.g. Palette::applyPaletteElement().
Selecting a range and double click on a double barline, the barline at the end of the measure is changed. With this PR, a double barline is created just before all selected ChordRest's.
If only one ChordRest is selected, the double barline is create again at the end of the measure.

Copy link
Contributor Author

@MarcSabatella MarcSabatella May 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm not following. This function isn't called when applying palette elements, only when actually clicking within the score. And the change here only applies to Ctrl+click. Unless there is something I'm missing? Were you able to duplicate a problem? I am not able to, but maybe I am misunderstanding the steps.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I can't reproduce it myself now. When I tried yesterday I got a very weird situation. I think it was related of a list which was, using this patch, converted into a range. And the problem is Palette::applyPaletteElement() handles the dropped element differently whether the selection is a list or a range.
Sorry, most likely not an issue at all, just confused with the different behavior of lists and ranges by Palette::applyPaletteElement().

e->score()->setUpdateAll(); // needed to clear selection rectangle
}
// e is the top element in stacking order,
// but we want to replace it with "first non-measure element after a selected element"
// (if such an element exists)
Expand Down