Skip to content

Commit

Permalink
Merge pull request #17685 from mike-spa/introduceIsSmallAccidentalOption
Browse files Browse the repository at this point in the history
Introduce "Small accidental" option
  • Loading branch information
RomanPudashkin committed May 29, 2023
2 parents 7a0b2bd + 4c46906 commit 9f6ebc6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Expand Up @@ -37,6 +37,7 @@ AccidentalSettingsModel::AccidentalSettingsModel(QObject* parent, IElementReposi
void AccidentalSettingsModel::createProperties()
{
m_bracketType = buildPropertyItem(mu::engraving::Pid::ACCIDENTAL_BRACKET);
m_isSmall = buildPropertyItem(mu::engraving::Pid::SMALL);
}

void AccidentalSettingsModel::requestElements()
Expand All @@ -47,6 +48,7 @@ void AccidentalSettingsModel::requestElements()
void AccidentalSettingsModel::loadProperties()
{
loadPropertyItem(m_bracketType);
loadPropertyItem(m_isSmall);
}

void AccidentalSettingsModel::resetProperties()
Expand All @@ -58,3 +60,8 @@ PropertyItem* AccidentalSettingsModel::bracketType() const
{
return m_bracketType;
}

PropertyItem* AccidentalSettingsModel::isSmall() const
{
return m_isSmall;
}
Expand Up @@ -30,6 +30,8 @@ class AccidentalSettingsModel : public AbstractInspectorModel
Q_OBJECT

Q_PROPERTY(PropertyItem * bracketType READ bracketType CONSTANT)
Q_PROPERTY(PropertyItem * isSmall READ isSmall CONSTANT)

public:
explicit AccidentalSettingsModel(QObject* parent, IElementRepositoryService* repository);

Expand All @@ -39,9 +41,11 @@ class AccidentalSettingsModel : public AbstractInspectorModel
void resetProperties() override;

PropertyItem* bracketType() const;
PropertyItem* isSmall() const;

private:
PropertyItem* m_bracketType = nullptr;
PropertyItem* m_isSmall = nullptr;
};
}

Expand Down
Expand Up @@ -58,4 +58,15 @@ Column {
{ iconCode: IconCode.BRACKET_PARENTHESES_SQUARE, value: AccidentalTypes.BRACKET_TYPE_SQUARE, title: qsTrc("inspector", "Brackets") }
]
}

CheckBoxPropertyView {
id: smallAccidentalCheckBox

text: qsTrc("inspector", "Small accidental")
propertyItem: root.model ? root.model.isSmall : null

navigation.name: "SmallAccidentalBox"
navigation.panel: root.navigationPanel
navigation.row: bracketType.navigation.row + 1
}
}

0 comments on commit 9f6ebc6

Please sign in to comment.