Skip to content

Commit

Permalink
fix #21841: Score tab and navigator remains after closing a score
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed May 19, 2014
1 parent 445058c commit 56177c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions mscore/musescore.cpp
Expand Up @@ -1522,10 +1522,11 @@ void MuseScore::setCurrentScoreView(ScoreView* view)
}
#endif
if (!cs) {
changeState(STATE_DISABLED);
setWindowTitle("MuseScore");
if (_navigator && _navigator->widget())
if (_navigator && _navigator->widget()) {
navigator()->setScoreView(view);
navigator()->setScore(0);
}
if (inspector)
inspector->setElement(0);
viewModeCombo->setEnabled(false);
Expand All @@ -1538,6 +1539,7 @@ void MuseScore::setCurrentScoreView(ScoreView* view)
_pianoTools->hide();
if (_drumTools)
_drumTools->hide();
changeState(STATE_DISABLED);
return;
}
viewModeCombo->setEnabled(true);
Expand Down Expand Up @@ -2001,6 +2003,8 @@ void MuseScore::removeTab(int i)
f.remove();
}
delete score;
// Shouldn't be necessary... but fix #21841
update();
}

//---------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions mscore/navigator.cpp
Expand Up @@ -138,7 +138,9 @@ void Navigator::setScoreView(ScoreView* v)
}
else {
_score = 0;
update();
updateViewRect();
//update() should be enough... see #21841
repaint();
}
}

Expand Down Expand Up @@ -297,7 +299,7 @@ void Navigator::paintEvent(QPaintEvent* ev)
{
QPainter p(this);
QRect r(ev->rect());
p.fillRect(r, Qt::gray);
p.fillRect(r, palette().color(QPalette::Window));

// qDebug("navigator paint %d %d", r.width(), r.height());

Expand Down

0 comments on commit 56177c3

Please sign in to comment.