fix #266162: Ability to hide arpeggio in standard staff when a tab staff is linked
This commit is contained in:
parent
fd9c0daca0
commit
7b17459939
6 changed files with 26 additions and 1 deletions
|
@ -122,7 +122,18 @@ void Arpeggio::layout()
|
|||
{
|
||||
qreal y1 = -_userLen1;
|
||||
qreal y2 = _height + _userLen2;
|
||||
|
||||
_hidden = false;
|
||||
if (score()->styleB(StyleIdx::ArpeggioHiddenInStdIfTab)) {
|
||||
if (staff() && staff()->isPitchedStaff(tick())) {
|
||||
for (Staff* s : staff()->staffList()) {
|
||||
if (s->score() == score() && s->isTabStaff(tick())) {
|
||||
_hidden = true;
|
||||
setbbox(QRect());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (staff())
|
||||
setMag(staff()->mag(tick()));
|
||||
switch (arpeggioType()) {
|
||||
|
@ -184,6 +195,8 @@ void Arpeggio::layout()
|
|||
|
||||
void Arpeggio::draw(QPainter* p) const
|
||||
{
|
||||
if (_hidden)
|
||||
return;
|
||||
qreal _spatium = spatium();
|
||||
|
||||
qreal y1 = -_userLen1;
|
||||
|
|
|
@ -38,6 +38,8 @@ class Arpeggio : public Element {
|
|||
std::vector<SymId> symbols;
|
||||
bool _playArpeggio;
|
||||
|
||||
bool _hidden = false; // set in layout, will skip draw if true
|
||||
|
||||
void symbolLine(SymId start, SymId fill);
|
||||
void symbolLine2(SymId end, SymId fill);
|
||||
|
||||
|
|
|
@ -246,6 +246,7 @@ static const StyleType styleTypes[] {
|
|||
{ StyleIdx::ArpeggioNoteDistance, "ArpeggioNoteDistance", Spatium(.5) },
|
||||
{ StyleIdx::ArpeggioLineWidth, "ArpeggioLineWidth", Spatium(.18) },
|
||||
{ StyleIdx::ArpeggioHookLen, "ArpeggioHookLen", Spatium(.8) },
|
||||
{ StyleIdx::ArpeggioHiddenInStdIfTab,"ArpeggioHiddenInStdIfTab",QVariant(false)},
|
||||
{ StyleIdx::SlurEndWidth, "slurEndWidth", Spatium(.07) },
|
||||
{ StyleIdx::SlurMidWidth, "slurMidWidth", Spatium(.15) },
|
||||
{ StyleIdx::SlurDottedWidth, "slurDottedWidth", Spatium(.10) },
|
||||
|
|
|
@ -222,6 +222,7 @@ enum class StyleIdx {
|
|||
ArpeggioNoteDistance,
|
||||
ArpeggioLineWidth,
|
||||
ArpeggioHookLen,
|
||||
ArpeggioHiddenInStdIfTab,
|
||||
|
||||
SlurEndWidth,
|
||||
SlurMidWidth,
|
||||
|
|
|
@ -174,6 +174,7 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
|
|||
{ StyleIdx::ArpeggioNoteDistance, false, arpeggioNoteDistance, 0 },
|
||||
{ StyleIdx::ArpeggioLineWidth, false, arpeggioLineWidth, 0 },
|
||||
{ StyleIdx::ArpeggioHookLen, false, arpeggioHookLen, 0 },
|
||||
{ StyleIdx::ArpeggioHiddenInStdIfTab,false, arpeggioHiddenInStdIfTab,0 },
|
||||
{ StyleIdx::SlurEndWidth, false, slurEndLineWidth, resetSlurEndLineWidth },
|
||||
{ StyleIdx::SlurMidWidth, false, slurMidLineWidth, resetSlurMidLineWidth },
|
||||
{ StyleIdx::SlurDottedWidth, false, slurDottedLineWidth, resetSlurDottedLineWidth },
|
||||
|
|
|
@ -4908,6 +4908,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="arpeggioHiddenInStdIfTab">
|
||||
<property name="text">
|
||||
<string>Do not show arpeggio in standard notation when displayed in tablature</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
|
Loading…
Reference in a new issue