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

dbl_click_fix #24002

Merged
merged 1 commit into from
Aug 14, 2024
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
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