Skip to content

Commit

Permalink
Merge pull request #24002 from RomanPudashkin/dbl_click_fix
Browse files Browse the repository at this point in the history
dbl_click_fix
  • Loading branch information
DmitryArefiev authored Aug 14, 2024
2 parents 7e19800 + 8bcec64 commit f1a01b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/notation/view/notationviewinputcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,12 @@ void NotationViewInputController::handleLeftClickRelease(const QPointF& releaseP
return;
}

if (m_shouldStartEditOnLeftClickRelease) {
dispatcher()->dispatch("edit-element", ActionData::make_arg1<PointF>(m_logicalBeginPoint));
m_shouldStartEditOnLeftClickRelease = false;
return;
}

const INotationInteraction::HitElementContext& ctx = hitElementContext();
if (!ctx.element) {
return;
Expand Down Expand Up @@ -953,16 +959,10 @@ void NotationViewInputController::mouseDoubleClickEvent(QMouseEvent* event)
return;
}

ActionCode actionCode;

if (hitElement->isMeasure() && event->modifiers() == Qt::NoModifier) {
actionCode = "note-input";
dispatcher()->dispatch("note-input", ActionData::make_arg1<PointF>(m_logicalBeginPoint));
} else if (hitElement->isInstrumentName()) {
actionCode = "edit-element";
}

if (!actionCode.empty()) {
dispatcher()->dispatch(actionCode, ActionData::make_arg1<PointF>(m_logicalBeginPoint));
m_shouldStartEditOnLeftClickRelease = true;
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/notation/view/notationviewinputcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ class NotationViewInputController : public muse::actions::Actionable, public mus

mu::engraving::EngravingItem* m_prevHitElement = nullptr;
mu::engraving::EngravingItem* m_prevSelectedElement = nullptr;

bool m_shouldStartEditOnLeftClickRelease = false;
bool m_shouldTogglePopupOnLeftClickRelease = false;
};
}
Expand Down

0 comments on commit f1a01b2

Please sign in to comment.