Skip to content

Fix #9476: Fix accidental note input bar and palette interaction #13563

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

Merged
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions src/engraving/libmscore/accidental.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ bool Accidental::acceptDrop(EditData& data) const
{
EngravingItem* e = data.dropElement;

if (e->type() == ElementType::ACCIDENTAL) {
return true;
}

if (e->isActionIcon()) {
ActionIconType type = toActionIcon(e)->actionType();
return type == ActionIconType::PARENTHESES
Expand All @@ -400,6 +404,9 @@ EngravingItem* Accidental::drop(EditData& data)
{
EngravingItem* e = data.dropElement;
switch (e->type()) {
case ElementType::ACCIDENTAL:
score()->changeAccidental(note(), toAccidental(e)->accidentalType());
break;
case ElementType::ACTION_ICON:
switch (toActionIcon(e)->actionType()) {
case ActionIconType::PARENTHESES:
Expand Down
23 changes: 21 additions & 2 deletions src/engraving/libmscore/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1960,8 +1960,27 @@ void Score::toggleAccidental(AccidentalType at, const EditData& ed)

void Score::changeAccidental(AccidentalType idx)
{
for (Note* note : selection().noteList()) {
changeAccidental(note, idx);
for (EngravingItem* item : selection().elements()) {
Accidental* accidental = 0;
Note* note = 0;
switch (item->type()) {
case ElementType::ACCIDENTAL:
accidental = toAccidental(item);

if (accidental->accidentalType() == idx) {
changeAccidental(accidental->note(), AccidentalType::NONE);
} else {
changeAccidental(accidental->note(), idx);
}

break;
case ElementType::NOTE:
note = toNote(item);
changeAccidental(note, idx);
break;
default:
break;
}
}
}

Expand Down