Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix system object layer text opacity #26975

Merged
merged 3 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ FocusableControl {
visible: root.type === LayoutPanelItemType.SYSTEM_OBJECTS_LAYER
Layout.alignment: Qt.AlignCenter
iconCode: IconCode.MINUS
enabled: model && model.itemRole.isVisible
opacity: model && model.itemRole.isVisible ? 1 : 0.75
}

Item {
Expand Down
13 changes: 13 additions & 0 deletions src/instrumentsscene/view/systemobjectslayertreeitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ static QString formatLayerTitle(const SystemObjectGroups& groups)
return title;
}

static bool isLayerVisible(const SystemObjectGroups& groups)
{
for (const SystemObjectsGroup& group : groups) {
if (isSystemObjectsGroupVisible(group)) {
return true;
}
}

return false;
}

SystemObjectsLayerTreeItem::SystemObjectsLayerTreeItem(IMasterNotationPtr masterNotation, INotationPtr notation, QObject* parent)
: AbstractLayoutPanelTreeItem(LayoutPanelItemType::SYSTEM_OBJECTS_LAYER, masterNotation, notation, parent)
{
Expand Down Expand Up @@ -217,4 +228,6 @@ void SystemObjectsLayerTreeItem::updateState()
{
setTitle(formatLayerTitle(m_systemObjectGroups));
setSettingsEnabled(!m_systemObjectGroups.empty());

setIsVisible(isLayerVisible(m_systemObjectGroups));
}