Skip to content

Commit 3f9229e

Browse files
mike-spaJojo-Schmitz
authored andcommitted
Don't show measure number if all staves invisible
1 parent 26236bc commit 3f9229e

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/engraving/dom/measure.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ bool Measure::showMeasureNumberOnStaff(staff_idx_t staffIdx) const
600600
return false;
601601
}
602602

603-
return showMeasureNumber() && score()->staff(staffIdx)->shouldShowMeasureNumbers();
603+
return showMeasureNumber() && score()->staff(staffIdx)->shouldShowMeasureNumbers() && !score()->allStavesInvisible();
604604
}
605605

606606
//---------------------------------------------------------

src/engraving/dom/score.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5874,6 +5874,17 @@ size_t Score::visibleStavesCount() const
58745874
return count;
58755875
}
58765876

5877+
bool Score::allStavesInvisible() const
5878+
{
5879+
for (const Staff* staff : m_staves) {
5880+
if (staff->show()) {
5881+
return false;
5882+
}
5883+
}
5884+
5885+
return true;
5886+
}
5887+
58775888
ShadowNote* Score::shadowNote() const
58785889
{
58795890
return m_shadowNote;

src/engraving/dom/score.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ class Score : public EngravingObject, public muse::Injectable
466466
const std::vector<Staff*>& staves() const { return m_staves; }
467467
size_t nstaves() const { return m_staves.size(); }
468468
size_t visibleStavesCount() const;
469+
bool allStavesInvisible() const;
469470
size_t ntracks() const { return m_staves.size() * VOICES; }
470471

471472
staff_idx_t staffIdx(const Staff*) const;

0 commit comments

Comments
 (0)