From 9353085fd0718ec50ab5af3c3227b8d2a1f1a3e3 Mon Sep 17 00:00:00 2001 From: Marc Sabatella Date: Tue, 3 Dec 2013 08:50:34 -0700 Subject: [PATCH] fix #23785: chord symbol text style changes Changes to chord symbol text style were not taking effect until reload. This change forces a render() call on all chord symbols if the text style changes. --- libmscore/harmony.cpp | 10 ++++++++++ libmscore/harmony.h | 1 + libmscore/text.h | 2 +- libmscore/undo.cpp | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libmscore/harmony.cpp b/libmscore/harmony.cpp index e1eab3568e6f..72deaec7d858 100644 --- a/libmscore/harmony.cpp +++ b/libmscore/harmony.cpp @@ -1130,6 +1130,16 @@ void Harmony::spatiumChanged(qreal oldValue, qreal newValue) render(); } +//--------------------------------------------------------- +// textStyleChanged +//--------------------------------------------------------- + +void Harmony::textStyleChanged() + { + Text::textStyleChanged(); + render(); + } + //--------------------------------------------------------- // dragAnchor //--------------------------------------------------------- diff --git a/libmscore/harmony.h b/libmscore/harmony.h index 940da371ff06..7f7067764299 100644 --- a/libmscore/harmony.h +++ b/libmscore/harmony.h @@ -167,6 +167,7 @@ class Harmony : public Text { const ChordDescription* fromXml(const QString& s, const QList&); const ChordDescription* fromXml(const QString& s); virtual void spatiumChanged(qreal oldValue, qreal newValue); + virtual void textStyleChanged(); virtual QLineF dragAnchor() const; void setHarmony(const QString& s); virtual QPainterPath shape() const; diff --git a/libmscore/text.h b/libmscore/text.h index fd4fa46e6a1e..aeece8ceb493 100644 --- a/libmscore/text.h +++ b/libmscore/text.h @@ -130,7 +130,7 @@ class Text : public SimpleText { void setModified(bool v); void clear(); QRectF pageRectangle() const; - void textStyleChanged(); + virtual void textStyleChanged(); virtual void setScore(Score* s); friend class TextProperties; diff --git a/libmscore/undo.cpp b/libmscore/undo.cpp index 4fb871a21ece..96dc2f536e66 100644 --- a/libmscore/undo.cpp +++ b/libmscore/undo.cpp @@ -2409,7 +2409,7 @@ static void updateTextStyle(void* a, Element* e) QString s = *(QString*)a; if (e->isText()) { Text* text = static_cast(e); - if (text->styled() && text->textStyle().name() == s) { + if ((text->styled() && text->textStyle().name() == s) || (text->type() == Element::HARMONY && s == "Chord Symbol")) { text->setTextStyle(text->score()->textStyle(s)); text->textStyleChanged(); }