Skip to content

[MU4] Add invisibility and colour to staff type change inspector #7397

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

Merged
merged 1 commit into from
Feb 3, 2021
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
16 changes: 16 additions & 0 deletions src/inspector/models/notation/stafftype/stafftypesettingsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ void StaffTypeSettingsModel::createProperties()
m_lineCount = buildPropertyItem(Ms::Pid::STAFF_LINES); // int
m_lineDistance = buildPropertyItem(Ms::Pid::LINE_DISTANCE);
m_stepOffset = buildPropertyItem(Ms::Pid::STEP_OFFSET); // int
m_isInvisible = buildPropertyItem(Ms::Pid::STAFF_INVISIBLE);
m_color = buildPropertyItem(Ms::Pid::STAFF_COLOR);

m_noteheadSchemeType = buildPropertyItem(Ms::Pid::HEAD_SCHEME);
m_isStemless = buildPropertyItem(Ms::Pid::STAFF_STEMLESS);
Expand Down Expand Up @@ -55,6 +57,8 @@ void StaffTypeSettingsModel::loadProperties()
loadPropertyItem(m_lineCount);
loadPropertyItem(m_lineDistance, formatDoubleFunc);
loadPropertyItem(m_stepOffset);
loadPropertyItem(m_isInvisible);
loadPropertyItem(m_color);

loadPropertyItem(m_noteheadSchemeType);
loadPropertyItem(m_isStemless);
Expand All @@ -74,6 +78,8 @@ void StaffTypeSettingsModel::resetProperties()
m_lineCount->resetToDefault();
m_lineDistance->resetToDefault();
m_stepOffset->resetToDefault();
m_isInvisible->resetToDefault();
m_color->resetToDefault();

m_noteheadSchemeType->resetToDefault();
m_isStemless->resetToDefault();
Expand Down Expand Up @@ -114,6 +120,16 @@ PropertyItem* StaffTypeSettingsModel::stepOffset() const
return m_stepOffset;
}

PropertyItem* StaffTypeSettingsModel::isInvisible() const
{
return m_isInvisible;
}

PropertyItem* StaffTypeSettingsModel::color() const
{
return m_color;
}

PropertyItem* StaffTypeSettingsModel::noteheadSchemeType() const
{
return m_noteheadSchemeType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class StaffTypeSettingsModel : public AbstractInspectorModel
Q_PROPERTY(PropertyItem * lineCount READ lineCount CONSTANT)
Q_PROPERTY(PropertyItem * lineDistance READ lineDistance CONSTANT)
Q_PROPERTY(PropertyItem * stepOffset READ stepOffset CONSTANT)
Q_PROPERTY(PropertyItem * isInvisible READ isInvisible CONSTANT)
Q_PROPERTY(PropertyItem * color READ color CONSTANT)

Q_PROPERTY(PropertyItem * noteheadSchemeType READ noteheadSchemeType CONSTANT)
Q_PROPERTY(PropertyItem * isStemless READ isStemless CONSTANT)
Expand All @@ -38,6 +40,8 @@ class StaffTypeSettingsModel : public AbstractInspectorModel
PropertyItem* lineCount() const;
PropertyItem* lineDistance() const;
PropertyItem* stepOffset() const;
PropertyItem* isInvisible() const;
PropertyItem* color() const;

PropertyItem* noteheadSchemeType() const;
PropertyItem* isStemless() const;
Expand All @@ -55,6 +59,8 @@ class StaffTypeSettingsModel : public AbstractInspectorModel
PropertyItem* m_lineCount = nullptr;
PropertyItem* m_lineDistance = nullptr;
PropertyItem* m_stepOffset = nullptr;
PropertyItem* m_isInvisible = nullptr;
PropertyItem* m_color = nullptr;

PropertyItem* m_noteheadSchemeType = nullptr;
PropertyItem* m_isStemless = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/inspector/view/inspector_resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
<file>qml/MuseScore/Inspector/general/appearance/internal/HorizontalSpacingSection.qml</file>
<file>qml/MuseScore/Inspector/general/appearance/internal/OffsetSection.qml</file>
<file>qml/MuseScore/Inspector/general/appearance/internal/ArrangeSection.qml</file>
<file>qml/MuseScore/Inspector/general/appearance/internal/ColorSection.qml</file>
<file>qml/MuseScore/Inspector/general/appearance/internal/VerticalSpacingSection.qml</file>
<file>resources/icons/question_mark.svg</file>
<file>qml/MuseScore/Inspector/notation/fermatas/FermataPopup.qml</file>
Expand Down Expand Up @@ -159,5 +158,6 @@
<file>qml/MuseScore/Inspector/notation/tremolos/TremoloPopup.qml</file>
<file>qml/MuseScore/Inspector/notation/measurerepeats/MeasureRepeatPopup.qml</file>
<file>qml/MuseScore/Inspector/notation/measurerepeats/MeasureRepeatSettings.qml</file>
<file>qml/MuseScore/Inspector/common/ColorSection.qml</file>
</qresource>
</RCC>
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import QtQuick 2.9
import QtQuick.Dialogs 1.2
import MuseScore.UiComponents 1.0
import "../../../common"

InspectorPropertyView {
id: root
Expand All @@ -11,7 +10,7 @@ InspectorPropertyView {
height: implicitHeight
width: parent.width

titleText: qsTrc("inspector", "Colour")
titleText: qsTrc("inspector", "Color")
propertyItem: root.color

ColorPicker {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,19 @@ StyledPopup {
}
}

CheckBox {
isIndeterminate: root.model ? root.model.isInvisible.isUndefined : false
checked: root.model && !isIndeterminate ? root.model.isInvisible.value : false
text: qsTrc("inspector", "Invisible staff lines")

onClicked: { root.model.isInvisible.value = !checked }
}

ColorSection {
titleText: qsTrc("inspector", "Staff line color")
color: root.model ? root.model.color : null
}

SeparatorLine { anchors.margins: -10 }

InspectorPropertyView {
Expand Down