Skip to content

Commit 4d9efc0

Browse files
committed
Start editing element after dropping onto the score
1 parent 8579f67 commit 4d9efc0

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/engraving/dom/cmd.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,6 @@ void Score::cmdAddSpanner(Spanner* spanner, const PointF& pos, bool systemStaves
598598

599599
bool ctrlModifier = isSystemTextLine(spanner) && !systemStavesOnly;
600600
undoAddElement(spanner, true /*addToLinkedStaves*/, ctrlModifier);
601-
select(spanner, SelectType::SINGLE, 0);
602601
}
603602

604603
//---------------------------------------------------------

src/notation/internal/notationinteraction.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,12 +1445,12 @@ bool NotationInteraction::drop(const PointF& pos, Qt::KeyboardModifiers modifier
14451445
switch (et) {
14461446
case ElementType::TEXTLINE:
14471447
systemStavesOnly = m_dropData.ed.dropElement->systemFlag();
1448-
// fall-thru
1448+
[[fallthrough]];
14491449
case ElementType::VOLTA:
14501450
case ElementType::GRADUAL_TEMPO_CHANGE:
14511451
// voltas drop to system staves by default, or closest staff if Control is held
14521452
systemStavesOnly = systemStavesOnly || !(m_dropData.ed.modifiers & Qt::ControlModifier);
1453-
// fall-thru
1453+
[[fallthrough]];
14541454
case ElementType::OTTAVA:
14551455
case ElementType::TRILL:
14561456
case ElementType::PEDAL:
@@ -1469,7 +1469,7 @@ bool NotationInteraction::drop(const PointF& pos, Qt::KeyboardModifiers modifier
14691469
case ElementType::FSYMBOL:
14701470
case ElementType::IMAGE:
14711471
applyUserOffset = true;
1472-
// fall-thru
1472+
[[fallthrough]];
14731473
case ElementType::DYNAMIC:
14741474
case ElementType::FRET_DIAGRAM:
14751475
case ElementType::HARMONY:
@@ -1550,17 +1550,21 @@ bool NotationInteraction::drop(const PointF& pos, Qt::KeyboardModifiers modifier
15501550
resetDropElement();
15511551
break;
15521552
}
1553+
1554+
EngravingItem* elementToSelect = m_dropData.ed.dropElement;
15531555
m_dropData.ed.dropElement = nullptr;
15541556
m_dropData.ed.pos = PointF();
15551557
m_dropData.ed.modifiers = {};
1556-
setDropTarget(nullptr); // this also resets dropRectangle and dropAnchor
1558+
1559+
setDropTarget(nullptr); // this also resets dropRectangle and dropAnchor
15571560
apply();
1558-
// update input cursor position (must be done after layout)
1559-
// if (noteEntryMode()) {
1560-
// moveCursor();
1561-
// }
1561+
15621562
if (accepted) {
15631563
notifyAboutDropChanged();
1564+
1565+
if (elementToSelect) {
1566+
selectAndStartEditIfNeeded(elementToSelect);
1567+
}
15641568
}
15651569

15661570
MScoreErrorsController(iocContext()).checkAndShowMScoreError();

0 commit comments

Comments
 (0)