-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
New percussion mouse input interaction & popup #26000
base: master
Are you sure you want to change the base?
New percussion mouse input interaction & popup #26000
Conversation
da5ed71
to
e9cfe53
Compare
e9cfe53
to
ae30d4d
Compare
ae30d4d
to
54069cb
Compare
54069cb
to
c015a98
Compare
nval.pitch = m_is.drumNote(); | ||
if (nval.pitch < 0 || !ds->isValid(nval.pitch) || ds->line(nval.pitch) != line) { | ||
// Drum note from input state is not valid - fall back to the first valid pitch for this line... | ||
m_is.setDrumNote(-1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that we change the input state here... Ideally, noteValForPosition should be const, and not change the state implicitly
} | ||
if (drumNotePitch < 0) { | ||
shadowNote.setVisible(false); | ||
m_shadowNoteChanged.notify(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not notify here, because this function is also used to draw the input by duration preview. The notification should be moved to NotationInteraction::showShadowNote
This PR implements the new percussion mouse input interaction and associated popup.
Part 1 -
ShadowNotePopup
groundwork (eb6c141 & 21cb8ed)Two of the main goals in this PR were to:
ElementPopup
logic as possible.With this in mind, the idea with this commit was to provide a generalised shadow-note popup which will determine its “content” based on the context (
ShadowNotePopupModel::currentPopupType
). This should help with future flexibility, for example if we wish to implement other shadow-note-based popups.A couple of optimisations were made to our existing
ElementPopup
logic. Firstly, we no longer attempt to show a popup if it is already showing - this is essential forShadowNotePopups
as we should try to update the visibility on everyhoverMoveEvent
. Second, the option to close a specific element popup is also included here - we need this because we don't want to close all element popups when shift is released, only the shadow-note popup....
Part 2 - Percussion shadow-note popup (c015a98)
The content of this commit is fairly self-explanatory. It implements the “percussion note content” UI and outlines the circumstances where
ShadowNotePopup
should load this content.This commit also contains logic for evaluating which percussion note should be inputted on click (see
Score::noteValForPosition
)