Skip to content

Commit

Permalink
Add existing property to system break inspector
Browse files Browse the repository at this point in the history
Leftover from musescore#7445, which ported musescore#6941 from 3.x to master
  • Loading branch information
Jojo-Schmitz committed Apr 18, 2024
1 parent 82dc839 commit cdbc5d0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ void SectionBreakSettingsModel::createProperties()
m_shouldStartWithLongInstrNames = buildPropertyItem(mu::engraving::Pid::START_WITH_LONG_NAMES);
m_shouldResetBarNums = buildPropertyItem(mu::engraving::Pid::START_WITH_MEASURE_ONE);
m_pauseDuration = buildPropertyItem(mu::engraving::Pid::PAUSE);
m_firstSystemIndent = buildPropertyItem(mu::engraving::Pid::FIRST_SYSTEM_INDENTATION);
}

void SectionBreakSettingsModel::requestElements()
Expand All @@ -52,13 +53,15 @@ void SectionBreakSettingsModel::loadProperties()
loadPropertyItem(m_shouldStartWithLongInstrNames);
loadPropertyItem(m_shouldResetBarNums);
loadPropertyItem(m_pauseDuration, formatDoubleFunc);
loadPropertyItem(m_firstSystemIndent);
}

void SectionBreakSettingsModel::resetProperties()
{
m_shouldStartWithLongInstrNames->resetToDefault();
m_shouldResetBarNums->resetToDefault();
m_pauseDuration->resetToDefault();
m_firstSystemIndent->resetToDefault();
}

PropertyItem* SectionBreakSettingsModel::shouldStartWithLongInstrNames() const
Expand All @@ -75,3 +78,8 @@ PropertyItem* SectionBreakSettingsModel::pauseDuration() const
{
return m_pauseDuration;
}

PropertyItem* SectionBreakSettingsModel::firstSystemIndent() const
{
return m_firstSystemIndent;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class SectionBreakSettingsModel : public AbstractInspectorModel
Q_PROPERTY(PropertyItem * shouldStartWithLongInstrNames READ shouldStartWithLongInstrNames CONSTANT)
Q_PROPERTY(PropertyItem * shouldResetBarNums READ shouldResetBarNums CONSTANT)
Q_PROPERTY(PropertyItem * pauseDuration READ pauseDuration CONSTANT)
Q_PROPERTY(PropertyItem * firstSystemIndent READ firstSystemIndent CONSTANT)

public:
explicit SectionBreakSettingsModel(QObject* parent, IElementRepositoryService* repository);
Expand All @@ -44,11 +45,13 @@ class SectionBreakSettingsModel : public AbstractInspectorModel
PropertyItem* shouldStartWithLongInstrNames() const;
PropertyItem* shouldResetBarNums() const;
PropertyItem* pauseDuration() const;
PropertyItem* firstSystemIndent() const;

private:
PropertyItem* m_shouldStartWithLongInstrNames = nullptr;
PropertyItem* m_shouldResetBarNums = nullptr;
PropertyItem* m_pauseDuration = nullptr;
PropertyItem* m_firstSystemIndent = nullptr;
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,22 @@ Column {
}

PropertyCheckBox {
id: shouldResetBarNums
text: qsTrc("inspector", "Reset measure numbers for new section")
propertyItem: root.model ? root.model.shouldResetBarNums : null

navigation.name: "ResetBarNumbers"
navigation.panel: root.navigationPanel
navigation.row: startWithLongInstrNames.navigation.row + 1
}

PropertyCheckBox {
id: startWithfirstSystemIndented
text: qsTrc("inspector", "Indent first system of new section")
propertyItem: root.model ? root.model.firstSystemIndent : null

navigation.name: "FirstSystemIndent"
navigation.panel: root.navigationPanel
navigation.row: shouldResetBarNums.navigation.row + 1
}
}

0 comments on commit cdbc5d0

Please sign in to comment.