Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #759 from Jojo-Schmitz/24491-header-footer-even-od…

…d-setting

fixes for header/footer even/odd setting
  • Loading branch information...
commit 6a2e41a097b8bd0fb113e9f8b682e79d66177b68 2 parents fe8e675 + 0a8cf7f
@wschweer wschweer authored
Showing with 49 additions and 3 deletions.
  1. +2 −3 libmscore/page.cpp
  2. +45 −0 mscore/editstyle.cpp
  3. +2 −0  mscore/editstyle.h
View
5 libmscore/page.cpp
@@ -223,7 +223,7 @@ void Page::draw(QPainter* painter) const
TextStyle ts = score()->textStyle(TEXT_STYLE_HEADER);
QPointF o(ts.offset(spatium()));
- bool odd = (n & 1) && _score->styleB(ST_headerOddEven);
+ bool odd = (n & 1) || !_score->styleB(ST_headerOddEven);
if (odd) {
o.setX(-o.x());
s1 = _score->styleSt(ST_oddHeaderL);
@@ -272,8 +272,7 @@ void Page::draw(QPainter* painter) const
QPointF o(ts.offset(spatium()));
- bool odd = (n & 1) && _score->styleB(ST_footerOddEven);
-
+ bool odd = (n & 1) || !_score->styleB(ST_footerOddEven);
if (odd) {
o.setX(-o.x());
s1 = _score->styleSt(ST_oddFooterL);
View
45 mscore/editstyle.cpp
@@ -151,6 +151,8 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
showHeader->setToolTip(toolTipHeaderFooter);
showFooter->setToolTip(toolTipHeaderFooter);
connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), SLOT(buttonClicked(QAbstractButton*)));
+ connect(headerOddEven, SIGNAL(toggled(bool)), SLOT(toggleHeaderOddEven(bool)));
+ connect(footerOddEven, SIGNAL(toggled(bool)), SLOT(toggleFooterOddEven(bool)));
connect(chordDescriptionFileButton, SIGNAL(clicked()), SLOT(selectChordDescriptionFile()));
connect(chordsStandard, SIGNAL(toggled(bool)), SLOT(setChordStyle(bool)));
connect(chordsJazz, SIGNAL(toggled(bool)), SLOT(setChordStyle(bool)));
@@ -661,6 +663,7 @@ void EditStyle::setValues()
headerStyled->setChecked(lstyle.value(ST_headerStyled).toBool());
showHeaderFirstPage->setChecked(lstyle.value(ST_headerFirstPage).toBool());
headerOddEven->setChecked(lstyle.value(ST_headerOddEven).toBool());
+ toggleHeaderOddEven(lstyle.value(ST_headerOddEven).toBool());
if (headerStyled->isChecked()) {
evenHeaderL->setPlainText(lstyle.value(ST_evenHeaderL).toString());
evenHeaderC->setPlainText(lstyle.value(ST_evenHeaderC).toString());
@@ -682,6 +685,7 @@ void EditStyle::setValues()
footerStyled->setChecked(lstyle.value(ST_footerStyled).toBool());
showFooterFirstPage->setChecked(lstyle.value(ST_footerFirstPage).toBool());
footerOddEven->setChecked(lstyle.value(ST_footerOddEven).toBool());
+ toggleFooterOddEven(lstyle.value(ST_footerOddEven).toBool());
if (footerStyled->isChecked()) {
evenFooterL->setPlainText(lstyle.value(ST_evenFooterL).toString());
evenFooterC->setPlainText(lstyle.value(ST_evenFooterC).toString());
@@ -783,6 +787,47 @@ void EditStyle::setChordStyle(bool checked)
}
//---------------------------------------------------------
+// toggleHeaderOddEven
+//---------------------------------------------------------
+
+void EditStyle::toggleHeaderOddEven(bool checked)
+ {
+ label_67->setEnabled(checked); // "Even"
+ if (checked)
+ label_66->setText(tr("Odd"));
+ else
+ label_66->setText(tr("Even/Odd"));
+ evenHeaderL->setEnabled(checked);
+ editEvenHeaderL->setEnabled(checked);
+ evenHeaderC->setEnabled(checked);
+ editEvenHeaderC->setEnabled(checked);
+ evenHeaderR->setEnabled(checked);
+ editEvenHeaderR->setEnabled(checked);
+ return;
+ }
+
+//---------------------------------------------------------
+// toggleFooterOddEven
+//---------------------------------------------------------
+
+void EditStyle::toggleFooterOddEven(bool checked)
+ {
+ label_80->setEnabled(checked); // "Even"
+ if (checked)
+ label_65->setText(tr("Odd"));
+ else
+ label_65->setText(tr("Even/Odd"));
+
+ evenFooterL->setEnabled(checked);
+ editEvenFooterL->setEnabled(checked);
+ evenFooterC->setEnabled(checked);
+ editEvenFooterC->setEnabled(checked);
+ evenFooterR->setEnabled(checked);
+ editEvenFooterR->setEnabled(checked);
+ return;
+ }
+
+//---------------------------------------------------------
// editTextClicked
//---------------------------------------------------------
View
2  mscore/editstyle.h
@@ -49,6 +49,8 @@ class EditStyle : public QDialog, private Ui::EditStyleBase {
private slots:
void selectChordDescriptionFile();
void setChordStyle(bool);
+ void toggleHeaderOddEven(bool);
+ void toggleFooterOddEven(bool);
void buttonClicked(QAbstractButton*);
void editTextClicked(int id);
void resetStyleValue(int i);
Please sign in to comment.
Something went wrong with that request. Please try again.