Skip to content

Commit

Permalink
fix #23785: chord symbol text style changes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MarcSabatella committed Dec 3, 2013
1 parent 63ee4cc commit 9353085
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions libmscore/harmony.cpp
Expand Up @@ -1130,6 +1130,16 @@ void Harmony::spatiumChanged(qreal oldValue, qreal newValue)
render();
}

//---------------------------------------------------------
// textStyleChanged
//---------------------------------------------------------

void Harmony::textStyleChanged()
{
Text::textStyleChanged();
render();
}

//---------------------------------------------------------
// dragAnchor
//---------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions libmscore/harmony.h
Expand Up @@ -167,6 +167,7 @@ class Harmony : public Text {
const ChordDescription* fromXml(const QString& s, const QList<HDegree>&);
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;
Expand Down
2 changes: 1 addition & 1 deletion libmscore/text.h
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libmscore/undo.cpp
Expand Up @@ -2409,7 +2409,7 @@ static void updateTextStyle(void* a, Element* e)
QString s = *(QString*)a;
if (e->isText()) {
Text* text = static_cast<Text*>(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();
}
Expand Down

0 comments on commit 9353085

Please sign in to comment.