File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,31 @@ engraving::PropertyValue Pedal::propertyDefault(Pid propertyId) const
196196 }
197197}
198198
199+ bool Pedal::setProperty (Pid propertyId, const PropertyValue& v)
200+ {
201+ // Update style flag for text
202+ if (propertyId == Pid::BEGIN_HOOK_TYPE) {
203+ setBeginHookType (v.value <HookType>());
204+
205+ PropertyFlags beginTextStyleFlag = beginText () == propertyDefault (Pid::BEGIN_TEXT).value <String>()
206+ ? PropertyFlags::STYLED : PropertyFlags::UNSTYLED;
207+ setPropertyFlags (Pid::BEGIN_TEXT, beginTextStyleFlag);
208+ PropertyFlags continueTextStyleFlag = continueText () == propertyDefault (Pid::CONTINUE_TEXT).value <String>()
209+ ? PropertyFlags::STYLED : PropertyFlags::UNSTYLED;
210+ setPropertyFlags (Pid::CONTINUE_TEXT, continueTextStyleFlag);
211+ } else if (propertyId == Pid::LINE_VISIBLE) {
212+ setLineVisible (v.toBool ());
213+ PropertyFlags endTextStyleFlag = endText () == propertyDefault (Pid::END_TEXT).value <String>()
214+ ? PropertyFlags::STYLED : PropertyFlags::UNSTYLED;
215+ setPropertyFlags (Pid::END_TEXT, endTextStyleFlag);
216+ } else {
217+ return TextLineBase::setProperty (propertyId, v);
218+ }
219+
220+ triggerLayout ();
221+ return true ;
222+ }
223+
199224Pedal* Pedal::findNextInStaff () const
200225{
201226 Fraction endTick = tick2 ();
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ class Pedal final : public TextLineBase
7272
7373 LineSegment* createLineSegment (System* parent) override ;
7474 PropertyValue propertyDefault (Pid propertyId) const override ;
75+ bool setProperty (Pid propertyId, const PropertyValue& v) override ;
7576
7677 Pedal* findNextInStaff () const ;
7778 bool connect45HookToNext () const ;
You can’t perform that action at this time.
0 commit comments