Skip to content

Commit 5893698

Browse files
authored
Merge pull request #29529 from mike-spa/portStuff
Port stuff
2 parents a3a7430 + 3bf140d commit 5893698

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/engraving/dom/staff.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ staff_idx_t Staff::idx() const
106106

107107
void Staff::triggerLayout() const
108108
{
109-
score()->setLayoutAll(idx());
109+
score()->setLayoutAll(idx(), this);
110110
}
111111

112112
void Staff::triggerLayout(const Fraction& tick)
@@ -231,7 +231,7 @@ void Staff::undoSetShowMeasureNumbers(bool show)
231231
bool Staff::shouldShowMeasureNumbers() const
232232
{
233233
if (style().styleB(Sid::measureNumberAllStaves)) {
234-
return true;
234+
return show();
235235
}
236236

237237
bool isTopStave = score()->staves().front() == this;

src/instrumentsscene/view/systemobjectslayertreeitem.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void SystemObjectsLayerTreeItem::onScoreChanged(const mu::engraving::ScoreChange
161161
continue;
162162
}
163163

164-
bool isSystemObj = item->systemFlag();
164+
bool isSystemObj = item->systemFlag() || (item->isStaff() && toStaff(item)->isSystemObjectStaff());
165165
if (!isSystemObj && item->isTimeSig()) {
166166
isSystemObj = toTimeSig(item)->timeSigPlacement() != TimeSigPlacement::NORMAL;
167167
}
@@ -175,7 +175,8 @@ void SystemObjectsLayerTreeItem::onScoreChanged(const mu::engraving::ScoreChange
175175
continue;
176176
}
177177

178-
if (item->staffIdx() != m_staffIdx) {
178+
staff_idx_t staffIdx = item->isStaff() ? toStaff(item)->idx() : item->staffIdx();
179+
if (staffIdx != m_staffIdx) {
179180
continue;
180181
}
181182

@@ -190,6 +191,7 @@ void SystemObjectsLayerTreeItem::onScoreChanged(const mu::engraving::ScoreChange
190191
shouldUpdateState |= addSystemObject(item);
191192
} else if (muse::contains(pair.second, CommandType::ChangeProperty)) {
192193
shouldUpdateState |= muse::contains(changes.changedPropertyIdSet, Pid::VISIBLE);
194+
shouldUpdateState |= muse::contains(changes.changedPropertyIdSet, Pid::SHOW_MEASURE_NUMBERS);
193195
}
194196
}
195197

src/notation/internal/notationparts.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,12 @@ void NotationParts::moveSystemObjects(const ID& sourceStaffId, const ID& destina
860860
score()->undoChangeStyleVal(Sid::systemObjectsBelowBottomStaff, false);
861861
}
862862

863+
AutoOnOff showMeasNumOnSrcStaff = srcStaff->getProperty(Pid::SHOW_MEASURE_NUMBERS).value<AutoOnOff>();
864+
if (showMeasNumOnSrcStaff != AutoOnOff::AUTO) {
865+
dstStaff->undoChangeProperty(Pid::SHOW_MEASURE_NUMBERS, showMeasNumOnSrcStaff);
866+
srcStaff->undoResetProperty(Pid::SHOW_MEASURE_NUMBERS);
867+
}
868+
863869
// Remove items first
864870
for (EngravingItem* item : systemObjects) {
865871
if (item->isTimeSig()) {
23.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)