Resolves: https://musescore.org/en/node/296127.
ScoreView::dragEnterEvent() must call event->accept() if event->dropAction() == Qt::CopyAction, even if for some reason (event->possibleActions() & Qt::CopyAction) evaluates to false, as is the case on macOS.
The version of Campania we just updated to (2.008) works fine on Windows
but apparently fails on macOS, at least on some systems in some cases.
The version of Campania incldued here is still built from the same basic sources,
but it turns off the "Apple" option within FontForge and turns on "Old-style kern".
This appears to fix the problem.
This adds a check for valid duration in ScoreView::cmdEnterRest() that was never strictly necessary before #5376 was merged. But now it is possible that the input state's duration may be invalid or equal to V_MEASURE, even if the check for invalid state does not cause the function to return early. If this is the case, we must set a valid duration at this time. Otherwise, this will result in an assertion failure in Score::makeGap().
Fixup for 99c7b0d746
triggerLayout() and triggerLayoutAll() implementations in Element
have an optimization that allows to avoid triggering layout for
elements not yet added to a score by checking the element's parent.
This optimization is not suitable for spanners since they don't have
a parent even when added to a score. This commit adds a missing
implementation of Spanner::triggerLayoutAll() that takes this into
account.
Resolves: https://musescore.org/en/node/296065.
Only add a *forced* accidental if there is an accidental selected in the toolbar and the note value is the same as it would be without an accidental.
A number of small issues prevent the special characters dialog
from working properly, especially for chord symbols.
Drag and drop only works with some symbols because FSYMBOL was missing
in the switch statements in dragdrop.cpp.
Text elements can handle drop of FSYMBOL (which is why double-click works),
but they weren't getting to chance during drag&drop.
Fix was just adding those case statements.
For Harmony objects, we also needed to add the handlers
in acceptDrop() and drop() (the latter just passing through to TextBase).
However, accidentals require special handling in Harmony::endEdit() in order to parse.
Code was added recently to do this, but it didn't actually work
(I suspect it did when written, but things changed between then and when it was merged).
I rearranged the code in in Harmony::endEdit() a bit - and added comments to explain.
Basically, setHarmony() needs to be called *after* the back-substitution
(replacing flat with "b", sharp with "#"),
but the back-substitution needs to happen after TextBase::endEdit() finalizes the text
(actually, if it were possible to substitute before, that would be better,
but do to the way the undo records are munged in TextBase::endEdit(),
it seemed to dangerous to even try).
Bottom line: I do the TextBase::endEdit(), then the back-substitution,
then the setHarmony().
I needed to be sure to trigger a layout, which required a startCmd/endCmd pair
(since TextBase::endEdit() already called endCmd).
We pre-populate the text of a chord symbol when commencing edit,
and process the text again upon completion of the edit.
But sometimes we used xmltext and other times we use plaintext.
It needs to be plaintext always for the conversion to work right:
we need to use plainText() when calling setHarmony(),
and we need to call setPlainText() when setting the text from the harmonyName().
Most of the rendering for RNA is handled by the Campania font,
so the main part of this change is just including the latest version of that font.
But I also needed to update some of the pre-processing of the RNA elements
to skip the special handling of parentheses and equals sign
(these too are handled directly by Campania).
Resolves: https://musescore.org/en/node/296053
The algorithm for finding a start point for note input works well in most cases,
in particular, if a measure or a note or reset is selected.
The cases were nothing is selected, or an element other than a note or rest is selected,
are sometimes good, sometimes we give up too easily
and select the first (or first visible) measure.
This change improves the no selection case by using the last-selected CR if it is in view
(using the recently-added code for remembering the last selected position).
It improves the case of soemthing other than a note or rest select
by using the actual tick of the element
rather than trying to guess a tick by looking for a parent measure.
That works for elements that are ultimately parented by a measure,
but fails for things like spanners, which are children of the system.
It turns out that SpannerSegment had no tick() function, so this failed at first,
but I added an override, which may well fix some other bug somewhere.
Another side benefit of the change is that if select an element not at the start of the measure
(for examplea mid-measure staff text), input starts at that tick,
not at the beginning of the measure.
The font style property is being converted from `FontStyle` to `bool` instead of `int`, so bold, italic and underline are all the same.
This commit fixes that.
Plus:
- fix incorrect list of workspaces appeared in the View->Workspaces menu
- fix not updating the workspace combobox on removing workspaces and saving edited workspaces