Skip to content

Commit

Permalink
Merge pull request #3447 from Jojo-Schmitz/ninMaxSystemDistance-2.2
Browse files Browse the repository at this point in the history
Fix #269238: make sure min and max system distance don't surpass one another
  • Loading branch information
lasconic authored Feb 8, 2018
2 parents ee1a123 + 14e5917 commit 8c08e62
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions mscore/editstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ EditStyle::EditStyle(Score* s, QWidget* parent)
connect(swingEighth, SIGNAL(toggled(bool)), SLOT(setSwingParams(bool)));
connect(swingSixteenth, SIGNAL(toggled(bool)), SLOT(setSwingParams(bool)));
connect(hideEmptyStaves, SIGNAL(clicked(bool)), dontHideStavesInFirstSystem, SLOT(setEnabled(bool)));
connect(minSystemDistance, SIGNAL(valueChanged(double)), SLOT(systemMinDistanceValueChanged(double)));
connect(maxSystemDistance, SIGNAL(valueChanged(double)), SLOT(systemMaxDistanceValueChanged(double)));

QSignalMapper* mapper = new QSignalMapper(this);

Expand Down Expand Up @@ -911,6 +913,27 @@ void EditStyle::toggleFooterOddEven(bool checked)
return;
}

//---------------------------------------------------------
// systemMin/MaxDistanceValueChanged
//
// Ensure minSystemDistance <= maxSystemDistance
//---------------------------------------------------------

void EditStyle::systemMaxDistanceValueChanged(double val)
{
double otherVal = minSystemDistance->value();
if (otherVal > val)
maxSystemDistance->setValue(otherVal);
}


void EditStyle::systemMinDistanceValueChanged(double val)
{
double otherVal = maxSystemDistance->value();
if (otherVal < val)
minSystemDistance->setValue(otherVal);
}

//---------------------------------------------------------
// setPage
//---------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions mscore/editstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class EditStyle : public QDialog, private Ui::EditStyleBase {
void toggleFooterOddEven(bool);
void buttonClicked(QAbstractButton*);
void setSwingParams(bool);
void systemMinDistanceValueChanged(double);
void systemMaxDistanceValueChanged(double);
void resetStyleValue(int i);

void on_comboFBFont_currentIndexChanged(int index);
Expand Down

0 comments on commit 8c08e62

Please sign in to comment.