Skip to content

Commit

Permalink
fix #24732: update Style for part in prefs dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Feb 19, 2014
1 parent b3461e9 commit 0aba0eb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libmscore/mscore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ MStyle* MScore::defaultStyle()

MStyle* MScore::defaultStyleForParts()
{
#if 0
if (!_defaultStyleForParts) {
QSettings s;
QString partStyle = s.value("partStyle").toString();
Expand All @@ -204,6 +205,7 @@ MStyle* MScore::defaultStyleForParts()
}
}
}
#endif
return _defaultStyleForParts;
}

Expand Down
10 changes: 10 additions & 0 deletions libmscore/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,25 @@ Score::Score(Score* parent)
_parentScore = parent;
init();

// inherit most style settings from parent
_style = *parent->style();

// style inheritance overrides
QSettings s;
QString partStyle = s.value("partStyle").toString();
if (!partStyle.isEmpty()) {
// allow "Style for part" preference to override
QFile f(partStyle);
if (f.open(QIODevice::ReadOnly))
_style.load(&f);
}
else {
// allow defaultStyle page layout settings to override
const PageFormat* pf = MScore::defaultStyle()->pageFormat();
qreal sp = MScore::defaultStyle()->spatium();
_style.setPageFormat(*pf);
_style.setSpatium(sp);
}

_synthesizerState = parent->_synthesizerState;
}
Expand Down
2 changes: 2 additions & 0 deletions mscore/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,8 @@ void PreferenceDialog::updateValues()
animations->setChecked(prefs.animations);

defaultStyle->setText(prefs.defaultStyleFile);
QSettings s;
partStyle->setText(s.value("partStyle").toString());

myScores->setText(prefs.myScoresPath);
myStyles->setText(prefs.myStylesPath);
Expand Down

0 comments on commit 0aba0eb

Please sign in to comment.