Skip to content

Commit 525031e

Browse files
Harmoniker1igorkorsukov
authored andcommitted
Add invisibility and colour to staff type change inspector
1 parent 67c8652 commit 525031e

File tree

5 files changed

+37
-3
lines changed

5 files changed

+37
-3
lines changed

src/inspector/models/notation/stafftype/stafftypesettingsmodel.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ void StaffTypeSettingsModel::createProperties()
2525
m_lineCount = buildPropertyItem(Ms::Pid::STAFF_LINES); // int
2626
m_lineDistance = buildPropertyItem(Ms::Pid::LINE_DISTANCE);
2727
m_stepOffset = buildPropertyItem(Ms::Pid::STEP_OFFSET); // int
28+
m_isInvisible = buildPropertyItem(Ms::Pid::STAFF_INVISIBLE);
29+
m_color = buildPropertyItem(Ms::Pid::STAFF_COLOR);
2830

2931
m_noteheadSchemeType = buildPropertyItem(Ms::Pid::HEAD_SCHEME);
3032
m_isStemless = buildPropertyItem(Ms::Pid::STAFF_STEMLESS);
@@ -55,6 +57,8 @@ void StaffTypeSettingsModel::loadProperties()
5557
loadPropertyItem(m_lineCount);
5658
loadPropertyItem(m_lineDistance, formatDoubleFunc);
5759
loadPropertyItem(m_stepOffset);
60+
loadPropertyItem(m_isInvisible);
61+
loadPropertyItem(m_color);
5862

5963
loadPropertyItem(m_noteheadSchemeType);
6064
loadPropertyItem(m_isStemless);
@@ -74,6 +78,8 @@ void StaffTypeSettingsModel::resetProperties()
7478
m_lineCount->resetToDefault();
7579
m_lineDistance->resetToDefault();
7680
m_stepOffset->resetToDefault();
81+
m_isInvisible->resetToDefault();
82+
m_color->resetToDefault();
7783

7884
m_noteheadSchemeType->resetToDefault();
7985
m_isStemless->resetToDefault();
@@ -114,6 +120,16 @@ PropertyItem* StaffTypeSettingsModel::stepOffset() const
114120
return m_stepOffset;
115121
}
116122

123+
PropertyItem* StaffTypeSettingsModel::isInvisible() const
124+
{
125+
return m_isInvisible;
126+
}
127+
128+
PropertyItem* StaffTypeSettingsModel::color() const
129+
{
130+
return m_color;
131+
}
132+
117133
PropertyItem* StaffTypeSettingsModel::noteheadSchemeType() const
118134
{
119135
return m_noteheadSchemeType;

src/inspector/models/notation/stafftype/stafftypesettingsmodel.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class StaffTypeSettingsModel : public AbstractInspectorModel
1515
Q_PROPERTY(PropertyItem * lineCount READ lineCount CONSTANT)
1616
Q_PROPERTY(PropertyItem * lineDistance READ lineDistance CONSTANT)
1717
Q_PROPERTY(PropertyItem * stepOffset READ stepOffset CONSTANT)
18+
Q_PROPERTY(PropertyItem * isInvisible READ isInvisible CONSTANT)
19+
Q_PROPERTY(PropertyItem * color READ color CONSTANT)
1820

1921
Q_PROPERTY(PropertyItem * noteheadSchemeType READ noteheadSchemeType CONSTANT)
2022
Q_PROPERTY(PropertyItem * isStemless READ isStemless CONSTANT)
@@ -38,6 +40,8 @@ class StaffTypeSettingsModel : public AbstractInspectorModel
3840
PropertyItem* lineCount() const;
3941
PropertyItem* lineDistance() const;
4042
PropertyItem* stepOffset() const;
43+
PropertyItem* isInvisible() const;
44+
PropertyItem* color() const;
4145

4246
PropertyItem* noteheadSchemeType() const;
4347
PropertyItem* isStemless() const;
@@ -55,6 +59,8 @@ class StaffTypeSettingsModel : public AbstractInspectorModel
5559
PropertyItem* m_lineCount = nullptr;
5660
PropertyItem* m_lineDistance = nullptr;
5761
PropertyItem* m_stepOffset = nullptr;
62+
PropertyItem* m_isInvisible = nullptr;
63+
PropertyItem* m_color = nullptr;
5864

5965
PropertyItem* m_noteheadSchemeType = nullptr;
6066
PropertyItem* m_isStemless = nullptr;

src/inspector/view/inspector_resources.qrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
<file>qml/MuseScore/Inspector/general/appearance/internal/HorizontalSpacingSection.qml</file>
6565
<file>qml/MuseScore/Inspector/general/appearance/internal/OffsetSection.qml</file>
6666
<file>qml/MuseScore/Inspector/general/appearance/internal/ArrangeSection.qml</file>
67-
<file>qml/MuseScore/Inspector/general/appearance/internal/ColorSection.qml</file>
6867
<file>qml/MuseScore/Inspector/general/appearance/internal/VerticalSpacingSection.qml</file>
6968
<file>resources/icons/question_mark.svg</file>
7069
<file>qml/MuseScore/Inspector/notation/fermatas/FermataPopup.qml</file>
@@ -159,5 +158,6 @@
159158
<file>qml/MuseScore/Inspector/notation/tremolos/TremoloPopup.qml</file>
160159
<file>qml/MuseScore/Inspector/notation/measurerepeats/MeasureRepeatPopup.qml</file>
161160
<file>qml/MuseScore/Inspector/notation/measurerepeats/MeasureRepeatSettings.qml</file>
161+
<file>qml/MuseScore/Inspector/common/ColorSection.qml</file>
162162
</qresource>
163163
</RCC>
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import QtQuick 2.9
22
import QtQuick.Dialogs 1.2
33
import MuseScore.UiComponents 1.0
4-
import "../../../common"
54

65
InspectorPropertyView {
76
id: root
@@ -11,7 +10,7 @@ InspectorPropertyView {
1110
height: implicitHeight
1211
width: parent.width
1312

14-
titleText: qsTrc("inspector", "Colour")
13+
titleText: qsTrc("inspector", "Color")
1514
propertyItem: root.color
1615

1716
ColorPicker {

src/inspector/view/qml/MuseScore/Inspector/notation/stafftype/StaffTypePopup.qml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,19 @@ StyledPopup {
166166
}
167167
}
168168

169+
CheckBox {
170+
isIndeterminate: root.model ? root.model.isInvisible.isUndefined : false
171+
checked: root.model && !isIndeterminate ? root.model.isInvisible.value : false
172+
text: qsTrc("inspector", "Invisible staff lines")
173+
174+
onClicked: { root.model.isInvisible.value = !checked }
175+
}
176+
177+
ColorSection {
178+
titleText: qsTrc("inspector", "Staff line color")
179+
color: root.model ? root.model.color : null
180+
}
181+
169182
SeparatorLine { anchors.margins: -10 }
170183

171184
InspectorPropertyView {

0 commit comments

Comments
 (0)