Skip to content

Commit

Permalink
Remove function
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-spa committed Feb 26, 2025
1 parent f5cd389 commit 6995008
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
30 changes: 0 additions & 30 deletions src/instrumentsscene/view/systemobjectslayertreeitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ void SystemObjectsLayerTreeItem::init(const Staff* staff, const SystemObjectGrou
bool isTopLayer = staff->score()->staff(0) == staff;
setIsRemovable(!isTopLayer);
setIsSelectable(!isTopLayer);

connect(this, &AbstractLayoutPanelTreeItem::isVisibleChanged, this, [this](bool isVisible) {
onVisibleChanged(isVisible);
});
}

const Staff* SystemObjectsLayerTreeItem::staff() const
Expand Down Expand Up @@ -181,28 +177,6 @@ void SystemObjectsLayerTreeItem::onScoreChanged(const mu::engraving::ScoreChange
}
}

void SystemObjectsLayerTreeItem::onVisibleChanged(bool isVisible)
{
if (m_ignoreVisibilityChanges || m_systemObjectGroups.empty()) {
return;
}

const muse::TranslatableString actionName = isVisible
? TranslatableString("undoableAction", "Make system marking(s) visible")
: TranslatableString("undoableAction", "Make system marking(s) invisible");

notation()->undoStack()->prepareChanges(actionName);

for (const SystemObjectsGroup& group : m_systemObjectGroups) {
for (engraving::EngravingItem* item : group.items) {
item->undoSetVisible(isVisible);
}
}

notation()->undoStack()->commitChanges();
notation()->notationChanged().notify();
}

bool SystemObjectsLayerTreeItem::addSystemObject(engraving::EngravingItem* obj)
{
for (auto& pair : m_systemObjectGroups) {
Expand Down Expand Up @@ -254,8 +228,4 @@ void SystemObjectsLayerTreeItem::updateState()
{
setTitle(formatLayerTitle(m_systemObjectGroups));
setSettingsEnabled(!m_systemObjectGroups.empty());

m_ignoreVisibilityChanges = true;
setIsVisible(isLayerVisible(m_systemObjectGroups));
m_ignoreVisibilityChanges = false;
}
2 changes: 0 additions & 2 deletions src/instrumentsscene/view/systemobjectslayertreeitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class SystemObjectsLayerTreeItem : public AbstractLayoutPanelTreeItem

private:
void onScoreChanged(const mu::engraving::ScoreChangesRange& changes) override;
void onVisibleChanged(bool isVisible);

bool addSystemObject(mu::engraving::EngravingItem* obj);
bool removeSystemObject(mu::engraving::EngravingItem* obj);
Expand All @@ -58,6 +57,5 @@ class SystemObjectsLayerTreeItem : public AbstractLayoutPanelTreeItem
const mu::engraving::Staff* m_staff = nullptr;
mu::engraving::staff_idx_t m_staffIdx = muse::nidx;
SystemObjectGroups m_systemObjectGroups;
bool m_ignoreVisibilityChanges = false;
};
}

0 comments on commit 6995008

Please sign in to comment.