Skip to content

Commit

Permalink
Introduced styles for pedal line texts
Browse files Browse the repository at this point in the history
  • Loading branch information
bakajikara committed Mar 20, 2023
1 parent fa2364e commit e1a60b2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/engraving/libmscore/pedal.cpp
Expand Up @@ -33,6 +33,9 @@ using namespace mu;

namespace mu::engraving {
static const ElementStyle pedalStyle {
{ Sid::pedalText, Pid::BEGIN_TEXT },
{ Sid::pedalContinueText, Pid::CONTINUE_TEXT },
{ Sid::pedalEndText, Pid::END_TEXT },
{ Sid::pedalFontFace, Pid::BEGIN_FONT_FACE },
{ Sid::pedalFontFace, Pid::CONTINUE_FONT_FACE },
{ Sid::pedalFontFace, Pid::END_FONT_FACE },
Expand Down Expand Up @@ -105,9 +108,6 @@ Pedal::Pedal(EngravingItem* parent)
{
initElementStyle(&pedalStyle);
setLineVisible(true);
resetProperty(Pid::BEGIN_TEXT);
resetProperty(Pid::CONTINUE_TEXT);
resetProperty(Pid::END_TEXT);

resetProperty(Pid::LINE_WIDTH);
resetProperty(Pid::LINE_STYLE);
Expand Down Expand Up @@ -150,9 +150,6 @@ void Pedal::write(XmlWriter& xml) const

for (auto i : {
Pid::END_HOOK_TYPE,
Pid::BEGIN_TEXT,
Pid::CONTINUE_TEXT,
Pid::END_TEXT,
Pid::LINE_VISIBLE,
Pid::BEGIN_HOOK_TYPE
}) {
Expand Down Expand Up @@ -197,9 +194,13 @@ engraving::PropertyValue Pedal::propertyDefault(Pid propertyId) const
return score()->styleV(Sid::pedalLineStyle);

case Pid::BEGIN_TEXT:
return score()->styleV(Sid::pedalText);

case Pid::CONTINUE_TEXT:
return score()->styleV(Sid::pedalContinueText);

case Pid::END_TEXT:
return "";
return score()->styleV(Sid::pedalEndText);

case Pid::BEGIN_TEXT_PLACE:
case Pid::CONTINUE_TEXT_PLACE:
Expand Down
3 changes: 3 additions & 0 deletions src/engraving/style/styledef.cpp
Expand Up @@ -282,6 +282,9 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::pedalFrameRound, "pedalFrameRound", 0 },
{ Sid::pedalFrameFgColor, "pedalFrameFgColor", Color::BLACK },
{ Sid::pedalFrameBgColor, "pedalFrameBgColor", Color::transparent },
{ Sid::pedalText, "pedalText", String() },
{ Sid::pedalContinueText, "pedalContinueText", String() },
{ Sid::pedalEndText, "pedalEndText", String() },

{ Sid::trillPlacement, "trillPlacement", PlacementV::ABOVE },
{ Sid::trillPosAbove, "trillPosAbove", PointF(.0, -0.5) },
Expand Down
3 changes: 3 additions & 0 deletions src/engraving/style/styledef.h
Expand Up @@ -297,6 +297,9 @@ enum class Sid {
pedalFrameRound,
pedalFrameFgColor,
pedalFrameBgColor,
pedalText,
pedalContinueText,
pedalEndText,

trillPlacement,
trillPosAbove,
Expand Down

0 comments on commit e1a60b2

Please sign in to comment.