From 427c8cd5d720d722416540e1976d96f30a0439a1 Mon Sep 17 00:00:00 2001 From: nasehim7 Date: Fri, 31 May 2024 18:46:18 +0100 Subject: [PATCH] Add: Accessibility Panel - Score Style Preset option --- share/styles/CMakeLists.txt | 2 +- share/styles/MSN/16mm_MSN.mss | 1420 +++++++++++++++++ share/styles/MSN/18mm_MSN.mss | 1016 ++++++++++++ share/styles/MSN/20mm_MSN.mss | 1350 ++++++++++++++++ share/styles/MSN/24mm_MSN.mss | 1016 ++++++++++++ share/styles/MSN/25mm_MSN.mss | 1350 ++++++++++++++++ share/styles/MSN/CMakeLists.txt | 8 + src/engraving/CMakeLists.txt | 2 + src/engraving/dom/property.cpp | 1 + src/engraving/dom/property.h | 1 + src/engraving/style/scorestylepreset.cpp | 45 + src/engraving/style/scorestylepreset.h | 49 + src/inspector/CMakeLists.txt | 2 + src/inspector/models/abstractinspectormodel.h | 1 + src/inspector/models/inspectorlistmodel.cpp | 7 +- .../score/scoreaccessibilitysettingsmodel.cpp | 150 ++ .../score/scoreaccessibilitysettingsmodel.h | 61 + src/inspector/view/inspector_resources.qrc | 1 + .../Inspector/InspectorSectionDelegate.qml | 20 + .../score/ScoreAccessibilityInspectorView.qml | 60 + 20 files changed, 6560 insertions(+), 2 deletions(-) create mode 100644 share/styles/MSN/16mm_MSN.mss create mode 100644 share/styles/MSN/18mm_MSN.mss create mode 100644 share/styles/MSN/20mm_MSN.mss create mode 100644 share/styles/MSN/24mm_MSN.mss create mode 100644 share/styles/MSN/25mm_MSN.mss create mode 100644 share/styles/MSN/CMakeLists.txt create mode 100644 src/engraving/style/scorestylepreset.cpp create mode 100644 src/engraving/style/scorestylepreset.h create mode 100644 src/inspector/models/score/scoreaccessibilitysettingsmodel.cpp create mode 100644 src/inspector/models/score/scoreaccessibilitysettingsmodel.h create mode 100644 src/inspector/view/qml/MuseScore/Inspector/score/ScoreAccessibilityInspectorView.qml diff --git a/share/styles/CMakeLists.txt b/share/styles/CMakeLists.txt index a5613cd4a252b..4710cb62ef07b 100644 --- a/share/styles/CMakeLists.txt +++ b/share/styles/CMakeLists.txt @@ -31,4 +31,4 @@ install(FILES cchords_sym.xml DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}styles ) - +add_subdirectory(MSN) diff --git a/share/styles/MSN/16mm_MSN.mss b/share/styles/MSN/16mm_MSN.mss new file mode 100644 index 0000000000000..cfab854ba0515 --- /dev/null +++ b/share/styles/MSN/16mm_MSN.mss @@ -0,0 +1,1420 @@ + + + + diff --git a/share/styles/MSN/18mm_MSN.mss b/share/styles/MSN/18mm_MSN.mss new file mode 100644 index 0000000000000..9cce9246fd922 --- /dev/null +++ b/share/styles/MSN/18mm_MSN.mss @@ -0,0 +1,1016 @@ + + + + diff --git a/share/styles/MSN/20mm_MSN.mss b/share/styles/MSN/20mm_MSN.mss new file mode 100644 index 0000000000000..b29260f2ca2b3 --- /dev/null +++ b/share/styles/MSN/20mm_MSN.mss @@ -0,0 +1,1350 @@ + + + + diff --git a/share/styles/MSN/24mm_MSN.mss b/share/styles/MSN/24mm_MSN.mss new file mode 100644 index 0000000000000..048a394b1cda1 --- /dev/null +++ b/share/styles/MSN/24mm_MSN.mss @@ -0,0 +1,1016 @@ + + + + diff --git a/share/styles/MSN/25mm_MSN.mss b/share/styles/MSN/25mm_MSN.mss new file mode 100644 index 0000000000000..4a720407f7fda --- /dev/null +++ b/share/styles/MSN/25mm_MSN.mss @@ -0,0 +1,1350 @@ + + + + diff --git a/share/styles/MSN/CMakeLists.txt b/share/styles/MSN/CMakeLists.txt new file mode 100644 index 0000000000000..bcbae9aed8dec --- /dev/null +++ b/share/styles/MSN/CMakeLists.txt @@ -0,0 +1,8 @@ +install(FILES + 16mm_MSN.mss + 18mm_MSN.mss + 20mm_MSN.mss + 24mm_MSN.mss + 25mm_MSN.mss + DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}styles/MSN + ) diff --git a/src/engraving/CMakeLists.txt b/src/engraving/CMakeLists.txt index f04741338caae..1c328b28fc33c 100644 --- a/src/engraving/CMakeLists.txt +++ b/src/engraving/CMakeLists.txt @@ -202,6 +202,8 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/style/style.h ${CMAKE_CURRENT_LIST_DIR}/style/defaultstyle.cpp ${CMAKE_CURRENT_LIST_DIR}/style/defaultstyle.h + ${CMAKE_CURRENT_LIST_DIR}/style/scorestylepreset.cpp + ${CMAKE_CURRENT_LIST_DIR}/style/scorestylepreset.h ${CMAKE_CURRENT_LIST_DIR}/rendering/README.h ${CMAKE_CURRENT_LIST_DIR}/rendering/iscorerenderer.h diff --git a/src/engraving/dom/property.cpp b/src/engraving/dom/property.cpp index 0d0cc2b0abfeb..eebb0543ecf94 100644 --- a/src/engraving/dom/property.cpp +++ b/src/engraving/dom/property.cpp @@ -439,6 +439,7 @@ static constexpr PropertyMetaData propertyList[] = { { Pid::SCORE_FONT, true, "scoreFont", P_TYPE::STRING, PropertyGroup::APPEARANCE, DUMMY_QT_TR_NOOP("propertyName", "score font") }, { Pid::SYMBOLS_SIZE, false, "symbolsSize", P_TYPE::REAL, PropertyGroup::APPEARANCE, DUMMY_QT_TR_NOOP("propertyName", "symbols size") }, { Pid::SYMBOL_ANGLE, false, "symbolAngle", P_TYPE::REAL, PropertyGroup::APPEARANCE, DUMMY_QT_TR_NOOP("propertyName", "symbol angle") }, + { Pid::SCORE_STYLE_PRESET, false, "scoreStylePreset", P_TYPE::STRING, PropertyGroup::APPEARANCE, DUMMY_QT_TR_NOOP("propertyName", "score style preset") }, { Pid::APPLY_TO_ALL_STAVES, false, "applyToAllStaves", P_TYPE::BOOL, PropertyGroup::NONE, DUMMY_QT_TR_NOOP("propertyName", "apply to all staves") }, diff --git a/src/engraving/dom/property.h b/src/engraving/dom/property.h index 744a014dc03c6..8d59468feef05 100644 --- a/src/engraving/dom/property.h +++ b/src/engraving/dom/property.h @@ -447,6 +447,7 @@ enum class Pid { SCORE_FONT, SYMBOLS_SIZE, SYMBOL_ANGLE, + SCORE_STYLE_PRESET, APPLY_TO_ALL_STAVES, diff --git a/src/engraving/style/scorestylepreset.cpp b/src/engraving/style/scorestylepreset.cpp new file mode 100644 index 0000000000000..059e5c9f9ad36 --- /dev/null +++ b/src/engraving/style/scorestylepreset.cpp @@ -0,0 +1,45 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2021 MuseScore Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "scorestylepreset.h" + +using namespace mu::engraving; + +muse::io::path_t ScoreStylePresetHelper::getStyleFilePath(ScoreStylePreset preset) const +{ + muse::io::path_t basePath = globalConfiguration()->appDataPath() + "styles/MSN/"; + switch (preset) { + case ScoreStylePreset::DEFAULT: + return engravingConfiguration()->defaultStyleFilePath(); + case ScoreStylePreset::MSN_16MM: + return basePath + "16mm_MSN.mss"; + case ScoreStylePreset::MSN_18MM: + return basePath + "18mm_MSN.mss"; + case ScoreStylePreset::MSN_20MM: + return basePath + "20mm_MSN.mss"; + case ScoreStylePreset::MSN_24MM: + return basePath + "24mm_MSN.mss"; + case ScoreStylePreset::MSN_25MM: + return basePath + "25mm_MSN.mss"; + default: + return muse::io::path_t(); + } +} diff --git a/src/engraving/style/scorestylepreset.h b/src/engraving/style/scorestylepreset.h new file mode 100644 index 0000000000000..87b8a1035a0cf --- /dev/null +++ b/src/engraving/style/scorestylepreset.h @@ -0,0 +1,49 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2021 MuseScore Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef MU_ENGRAVING_SCORESTYLEPRESET_H +#define MU_ENGRAVING_SCORESTYLEPRESET_H + +#include "global/iglobalconfiguration.h" +#include "engraving/iengravingconfiguration.h" +#include "modularity/ioc.h" + +namespace mu::engraving { +enum class ScoreStylePreset { + CUSTOM, + DEFAULT, + MSN_16MM, + MSN_18MM, + MSN_20MM, + MSN_24MM, + MSN_25MM +}; + +class ScoreStylePresetHelper +{ + INJECT(muse::IGlobalConfiguration, globalConfiguration); + INJECT(engraving::IEngravingConfiguration, engravingConfiguration); +public: + muse::io::path_t getStyleFilePath(ScoreStylePreset preset) const; +}; +} // namespace mu::engraving + +#endif // MU_ENGRAVING_SCORESTYLEPRESET_H diff --git a/src/inspector/CMakeLists.txt b/src/inspector/CMakeLists.txt index 9806b49e81d72..2e1eb52636362 100644 --- a/src/inspector/CMakeLists.txt +++ b/src/inspector/CMakeLists.txt @@ -86,6 +86,8 @@ set(MODULE_SRC ${CMAKE_CURRENT_LIST_DIR}/models/measures/measuressettingsmodel.h ${CMAKE_CURRENT_LIST_DIR}/models/score/scoreappearancesettingsmodel.cpp ${CMAKE_CURRENT_LIST_DIR}/models/score/scoreappearancesettingsmodel.h + ${CMAKE_CURRENT_LIST_DIR}/models/score/scoreaccessibilitysettingsmodel.cpp + ${CMAKE_CURRENT_LIST_DIR}/models/score/scoreaccessibilitysettingsmodel.h ${CMAKE_CURRENT_LIST_DIR}/models/score/scoredisplaysettingsmodel.cpp ${CMAKE_CURRENT_LIST_DIR}/models/score/scoredisplaysettingsmodel.h ${CMAKE_CURRENT_LIST_DIR}/models/score/internal/pagetypelistmodel.cpp diff --git a/src/inspector/models/abstractinspectormodel.h b/src/inspector/models/abstractinspectormodel.h index dcb3b3eda10ba..034e4e42af8df 100644 --- a/src/inspector/models/abstractinspectormodel.h +++ b/src/inspector/models/abstractinspectormodel.h @@ -65,6 +65,7 @@ class AbstractInspectorModel : public QObject, public muse::async::Asyncable SECTION_TEXT, SECTION_SCORE_DISPLAY, SECTION_SCORE_APPEARANCE, + SECTION_SCORE_ACCESSIBILITY, SECTION_PARTS, }; Q_ENUM(InspectorSectionType) diff --git a/src/inspector/models/inspectorlistmodel.cpp b/src/inspector/models/inspectorlistmodel.cpp index 212951ddb1f05..bae2afc954328 100644 --- a/src/inspector/models/inspectorlistmodel.cpp +++ b/src/inspector/models/inspectorlistmodel.cpp @@ -28,6 +28,7 @@ #include "text/textsettingsmodel.h" #include "score/scoredisplaysettingsmodel.h" #include "score/scoreappearancesettingsmodel.h" +#include "score/scoreaccessibilitysettingsmodel.h" #include "notation/inotationinteraction.h" #include "internal/services/elementrepositoryservice.h" @@ -73,7 +74,8 @@ void InspectorListModel::buildModelsForEmptySelection() static const InspectorSectionTypeSet persistentSections { InspectorSectionType::SECTION_SCORE_DISPLAY, - InspectorSectionType::SECTION_SCORE_APPEARANCE + InspectorSectionType::SECTION_SCORE_APPEARANCE, + InspectorSectionType::SECTION_SCORE_ACCESSIBILITY }; removeUnusedModels({}, false /*isRangeSelection*/, {}, persistentSections); @@ -195,6 +197,9 @@ void InspectorListModel::createModelsBySectionType(const InspectorSectionTypeSet case InspectorSectionType::SECTION_SCORE_APPEARANCE: newModel = new ScoreAppearanceSettingsModel(this, m_repository); break; + case InspectorSectionType::SECTION_SCORE_ACCESSIBILITY: + newModel = new ScoreAccessibilitySettingsModel(this, m_repository); + break; case InspectorSectionType::SECTION_PARTS: newModel = new PartsSettingsModel(this, m_repository); break; diff --git a/src/inspector/models/score/scoreaccessibilitysettingsmodel.cpp b/src/inspector/models/score/scoreaccessibilitysettingsmodel.cpp new file mode 100644 index 0000000000000..819a732353253 --- /dev/null +++ b/src/inspector/models/score/scoreaccessibilitysettingsmodel.cpp @@ -0,0 +1,150 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2021 MuseScore Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "scoreaccessibilitysettingsmodel.h" + +#include "translation.h" +#include "log.h" + +using namespace mu::inspector; +using namespace mu::notation; + +ScoreAccessibilitySettingsModel::ScoreAccessibilitySettingsModel(QObject* parent, IElementRepositoryService* repository) + : AbstractInspectorModel(parent, repository) +{ + setSectionType(InspectorSectionType::SECTION_SCORE_ACCESSIBILITY); + setTitle(muse::qtrc("inspector", "Accessibility")); + createProperties(); + connect(m_scoreStylePreset, &PropertyItem::valueChanged, this, [this]() { + if (!m_ignoreStyleChange) { + setScoreStylePreset(m_scoreStylePreset); + } + }); + + globalContext()->currentNotation()->style()->styleChanged().onNotify(this, [this]() { + if (!m_ignoreStyleChange && m_scoreStylePreset->value().toInt() != static_cast(mu::engraving::ScoreStylePreset::CUSTOM)) { + m_scoreStylePreset->setValue(static_cast(mu::engraving::ScoreStylePreset::CUSTOM)); + emit scoreStylePresetChanged(); + } + }); +} + +PropertyItem* ScoreAccessibilitySettingsModel::scoreStylePreset() const +{ + return m_scoreStylePreset; +} + +void ScoreAccessibilitySettingsModel::setScoreStylePreset(PropertyItem* preset) +{ + m_ignoreStyleChange = true; + m_scoreStylePreset = preset; + loadStyle(preset); + emit scoreStylePresetChanged(); + m_ignoreStyleChange = false; +} + +void ScoreAccessibilitySettingsModel::createProperties() +{ + m_scoreStylePreset = buildPropertyItem(mu::engraving::Pid::SCORE_STYLE_PRESET); + m_scoreStylePreset->setDefaultValue(static_cast(mu::engraving::ScoreStylePreset::DEFAULT)); + m_scoreStylePreset->setValue(static_cast(mu::engraving::ScoreStylePreset::DEFAULT)); +} + +void ScoreAccessibilitySettingsModel::requestElements() +{ + // Placeholder +} + +void ScoreAccessibilitySettingsModel::loadProperties() +{ + static PropertyIdSet propertyIdSet { + Pid::SCORE_STYLE_PRESET + }; + + loadProperties(propertyIdSet); +} + +void ScoreAccessibilitySettingsModel::loadProperties(const mu::engraving::PropertyIdSet& propertyIdSet) +{ + if (muse::contains(propertyIdSet, Pid::SCORE_STYLE_PRESET)) { + loadPropertyItem(m_scoreStylePreset); + } +} + +void ScoreAccessibilitySettingsModel::resetProperties() +{ + m_scoreStylePreset->resetToDefault(); + emit scoreStylePresetChanged(); +} + +QVariantList ScoreAccessibilitySettingsModel::possibleScoreStylePreset() const +{ + QMap types { + { mu::engraving::ScoreStylePreset::DEFAULT, muse::qtrc("inspector", "Default") }, + { mu::engraving::ScoreStylePreset::MSN_16MM, muse::qtrc("inspector", "16mm MSN") }, + { mu::engraving::ScoreStylePreset::MSN_18MM, muse::qtrc("inspector", "18mm MSN") }, + { mu::engraving::ScoreStylePreset::MSN_20MM, muse::qtrc("inspector", "20mm MSN") }, + { mu::engraving::ScoreStylePreset::MSN_24MM, muse::qtrc("inspector", "24mm MSN") }, + { mu::engraving::ScoreStylePreset::MSN_25MM, muse::qtrc("inspector", "25mm MSN") } + }; + + QVariantList result; + + if (m_scoreStylePreset->value().toInt() == static_cast(mu::engraving::ScoreStylePreset::CUSTOM)) { + QVariantMap customObj; + customObj["text"] = muse::qtrc("inspector", "Custom"); + customObj["value"] = static_cast(mu::engraving::ScoreStylePreset::CUSTOM); + result << customObj; + } + + for (mu::engraving::ScoreStylePreset type : types.keys()) { + QVariantMap obj; + obj["text"] = types[type]; + obj["value"] = static_cast(type); + result << obj; + } + + return result; +} + +void ScoreAccessibilitySettingsModel::loadStyle(PropertyItem* preset) +{ + int presetValue = preset->value().toInt(); + + mu::engraving::ScoreStylePreset stylePreset = static_cast(presetValue); + + mu::engraving::ScoreStylePresetHelper scoreStylePresetHelper; + muse::io::path_t filePath = scoreStylePresetHelper.getStyleFilePath(stylePreset); + + if (stylePreset == mu::engraving::ScoreStylePreset::DEFAULT) { + if (filePath.empty()) { + mu::engraving::StyleIdSet emptySet; + globalContext()->currentNotation()->style()->resetAllStyleValues(emptySet); + } else { + globalContext()->currentNotation()->style()->loadStyle(filePath, true); + } + } else if (!filePath.empty()) { + LOGI() << "Loading style from filePath:" << filePath; + globalContext()->currentNotation()->style()->loadStyle(filePath, true); + } else { + LOGI() << "filePath is empty"; + } +} diff --git a/src/inspector/models/score/scoreaccessibilitysettingsmodel.h b/src/inspector/models/score/scoreaccessibilitysettingsmodel.h new file mode 100644 index 0000000000000..004f2c645cfc2 --- /dev/null +++ b/src/inspector/models/score/scoreaccessibilitysettingsmodel.h @@ -0,0 +1,61 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2021 MuseScore Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef MU_INSPECTOR_SCOREACCESSIBILITYSETTINGSMODEL_H +#define MU_INSPECTOR_SCOREACCESSIBILITYSETTINGSMODEL_H + +#include "models/abstractinspectormodel.h" +#include "models/propertyitem.h" +#include "async/asyncable.h" +#include "context/iglobalcontext.h" +#include "engraving/style/scorestylepreset.h" + +namespace mu::inspector { +class ScoreAccessibilitySettingsModel : public AbstractInspectorModel +{ + Q_OBJECT + INJECT(mu::context::IGlobalContext, globalContext) + Q_PROPERTY(PropertyItem * scoreStylePreset READ scoreStylePreset WRITE setScoreStylePreset NOTIFY scoreStylePresetChanged) + +public: + explicit ScoreAccessibilitySettingsModel(QObject* parent, IElementRepositoryService* repository); + + void createProperties() override; + void requestElements() override; + void loadProperties() override; + void resetProperties() override; + + PropertyItem* scoreStylePreset() const; + void setScoreStylePreset(PropertyItem* preset); + Q_INVOKABLE QVariantList possibleScoreStylePreset() const; + void loadStyle(PropertyItem* preset); + + void loadProperties(const mu::engraving::PropertyIdSet& propertyIdSet); + +signals: + void scoreStylePresetChanged(); +private: + PropertyItem* m_scoreStylePreset = nullptr; + bool m_ignoreStyleChange = false; +}; +} + +#endif // MU_INSPECTOR_SCOREACCESSIBILITYSETTINGSMODEL_H diff --git a/src/inspector/view/inspector_resources.qrc b/src/inspector/view/inspector_resources.qrc index 3d99c193f5753..5e0c7f8000b23 100644 --- a/src/inspector/view/inspector_resources.qrc +++ b/src/inspector/view/inspector_resources.qrc @@ -50,6 +50,7 @@ qml/MuseScore/Inspector/notation/fretdiagrams/internal/FretAdvancedSettingsTab.qml qml/MuseScore/Inspector/score/ScoreDisplayInspectorView.qml qml/MuseScore/Inspector/score/ScoreAppearanceInspectorView.qml + qml/MuseScore/Inspector/score/ScoreAccessibilityInspectorView.qml qml/MuseScore/Inspector/score/HideEmptyStavesSettings.qml qml/MuseScore/Inspector/common/InspectorPropertyView.qml qml/MuseScore/Inspector/common/TextSection.qml diff --git a/src/inspector/view/qml/MuseScore/Inspector/InspectorSectionDelegate.qml b/src/inspector/view/qml/MuseScore/Inspector/InspectorSectionDelegate.qml index 5455947ff5dd8..88d0576f5a52f 100644 --- a/src/inspector/view/qml/MuseScore/Inspector/InspectorSectionDelegate.qml +++ b/src/inspector/view/qml/MuseScore/Inspector/InspectorSectionDelegate.qml @@ -73,6 +73,7 @@ ExpandableBlank { } case Inspector.SECTION_SCORE_DISPLAY: return scoreSection case Inspector.SECTION_SCORE_APPEARANCE: return scoreAppearanceSection + case Inspector.SECTION_SCORE_ACCESSIBILITY: return scoreAccessibilitySection case Inspector.SECTION_PARTS: return partsSection } @@ -206,6 +207,25 @@ ExpandableBlank { } } + Component { + id: scoreAccessibilitySection + + ScoreAccessibilityInspectorView { + model: root.sectionModel + navigationPanel: root.navigationPanel + navigationRowStart: root.navigation.row + 1 + anchorItem: root.anchorItem + + onEnsureContentVisibleRequested: function(invisibleContentHeight) { + root.ensureContentVisibleRequested(-invisibleContentHeight) + } + + onPopupOpened: { + root.popupOpened(openedPopup, control) + } + } + } + Component { id: partsSection diff --git a/src/inspector/view/qml/MuseScore/Inspector/score/ScoreAccessibilityInspectorView.qml b/src/inspector/view/qml/MuseScore/Inspector/score/ScoreAccessibilityInspectorView.qml new file mode 100644 index 0000000000000..64afaf1d7c485 --- /dev/null +++ b/src/inspector/view/qml/MuseScore/Inspector/score/ScoreAccessibilityInspectorView.qml @@ -0,0 +1,60 @@ +/* + * SPDX-License-Identifier: GPL-3.0-only + * MuseScore-Studio-CLA-applies + * + * MuseScore Studio + * Music Composition & Notation + * + * Copyright (C) 2021 MuseScore Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.15 + +import MuseScore.Inspector 1.0 +import Muse.UiComponents 1.0 +import Muse.Ui 1.0 + +import "../common" + +InspectorSectionView { + id: root + + implicitHeight: contentColumn.implicitHeight + + Column { + id: contentColumn + width: parent.width + spacing: 8 + + DropdownPropertyView { + id: scoreStylePreset + + titleText: qsTrc("inspector", "Score style preset") + propertyItem: root.model ? root.model.scoreStylePreset : null + visible: true + enabled: true + + model: root.model ? root.model.possibleScoreStylePreset() : [] + + Connections { + target: root.model + onScoreStylePresetChanged: { + scoreStylePreset.model = root.model ? root.model.possibleScoreStylePreset() : []; + } + } + } + } +}