Restrict "all lines attached to stem" tremolo beam style to non-tab staves

This commit is contained in:
Howard-C 2020-01-17 19:14:50 +08:00
parent 9cde80bd56
commit d3f9f6baa9
3 changed files with 12 additions and 5 deletions

View file

@ -12,6 +12,7 @@
#include "tremolo.h"
#include "score.h"
#include "staff.h"
#include "style.h"
#include "chord.h"
#include "note.h"
@ -397,8 +398,9 @@ void Tremolo::layoutTwoNotesTremolo(qreal x, qreal y, qreal h, qreal _spatium)
{
bool defaultStyle = (beamStyle() == TremoloBeamStyle::DEFAULT);
// non-default beam styles are only appliable to minim two-note tremolo
if (durationType() != TDuration::DurationType::V_HALF)
// non-default beam styles are only appliable to minim two-note tremolo in non-TAB staves
if (durationType() != TDuration::DurationType::V_HALF
|| staff()->staffType(tick())->group() == StaffGroup::TAB)
defaultStyle = true;
y += (h - bbox().height()) * .5;

View file

@ -31,7 +31,7 @@ enum class TremoloPlacement : signed char {
DEFAULT = 0, STEM_CENTER
};
// only appliable to minim two-note tremolo
// only appliable to minim two-note tremolo in non-TAB staves
enum class TremoloBeamStyle : signed char {
DEFAULT = 0, ALL_LINES_ATTACHED
};

View file

@ -1039,14 +1039,19 @@ void InspectorTremolo::setElement()
{
InspectorElementBase::setElement();
bool hasNonMinimTwoNoteTremolo = false;
bool hasTabStaffTremolo = false;
for (Element* ee : *(inspector->el())) {
if (toTremolo(ee)->durationType() != TDuration::DurationType::V_HALF) {
hasNonMinimTwoNoteTremolo = true;
break;
}
if (toTremolo(ee)->staffType()->group() == StaffGroup::TAB) {
hasTabStaffTremolo = true;
break;
}
}
// beam style setting is only appliable to minim two-note tremolo
if (hasNonMinimTwoNoteTremolo) {
// beam style setting is only appliable to minim two-note tremolo in non-TAB staves
if (hasNonMinimTwoNoteTremolo || hasTabStaffTremolo) {
g.labelBeamStyle->setVisible(false);
g.beamStyle->setVisible(false);
g.resetBeamStyle->setVisible(false);