From 70b94d9888351cfcaa40e2a7fe58426803a97319 Mon Sep 17 00:00:00 2001
From: bakajikara <102702868+bakajikara@users.noreply.github.com>
Date: Wed, 15 Feb 2023 20:33:26 +0900
Subject: [PATCH] Added text tab to pedal line properties (#14928)
---
.../notation/lines/pedalsettingsmodel.cpp | 14 ---
.../notation/lines/pedalsettingsmodel.h | 6 --
src/inspector/view/inspector_resources.qrc | 2 +-
.../NotationInspectorSectionLoader.qml | 7 +-
.../Inspector/notation/lines/LineSettings.qml | 12 +++
.../notation/lines/PedalSettings.qml | 101 ------------------
.../lines/internal/PedalStyleSettings.qml | 90 ++++++++++++++++
7 files changed, 104 insertions(+), 128 deletions(-)
delete mode 100644 src/inspector/view/qml/MuseScore/Inspector/notation/lines/PedalSettings.qml
create mode 100644 src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/PedalStyleSettings.qml
diff --git a/src/inspector/models/notation/lines/pedalsettingsmodel.cpp b/src/inspector/models/notation/lines/pedalsettingsmodel.cpp
index 8ab87849304e3..18a5a7053786f 100644
--- a/src/inspector/models/notation/lines/pedalsettingsmodel.cpp
+++ b/src/inspector/models/notation/lines/pedalsettingsmodel.cpp
@@ -57,11 +57,6 @@ PropertyItem* PedalSettingsModel::lineType() const
return m_lineType;
}
-bool PedalSettingsModel::pedalSymbolVisible() const
-{
- return beginningText()->value().toString() == mu::engraving::Pedal::PEDAL_SYMBOL;
-}
-
bool PedalSettingsModel::isChangingLineVisibilityAllowed() const
{
return isStarSymbolVisible();
@@ -72,19 +67,10 @@ bool PedalSettingsModel::isStarSymbolVisible() const
return endText()->value().toString() == mu::engraving::Pedal::STAR_SYMBOL;
}
-void PedalSettingsModel::setPedalSymbolVisible(bool visible)
-{
- beginningText()->setValue(visible ? mu::engraving::Pedal::PEDAL_SYMBOL.toQString() : "");
-}
-
void PedalSettingsModel::createProperties()
{
TextLineSettingsModel::createProperties();
- connect(beginningText(), &PropertyItem::isModifiedChanged, this, [this]() {
- emit pedalSymbolVisibleChanged();
- });
-
connect(endText(), &PropertyItem::isModifiedChanged, this, [this]() {
emit isChangingLineVisibilityAllowedChanged();
});
diff --git a/src/inspector/models/notation/lines/pedalsettingsmodel.h b/src/inspector/models/notation/lines/pedalsettingsmodel.h
index b64d8d558df8a..87aa5070e2b32 100644
--- a/src/inspector/models/notation/lines/pedalsettingsmodel.h
+++ b/src/inspector/models/notation/lines/pedalsettingsmodel.h
@@ -30,21 +30,15 @@ class PedalSettingsModel : public TextLineSettingsModel
Q_OBJECT
Q_PROPERTY(PropertyItem * lineType READ lineType CONSTANT)
- Q_PROPERTY(bool pedalSymbolVisible READ pedalSymbolVisible WRITE setPedalSymbolVisible NOTIFY pedalSymbolVisibleChanged)
Q_PROPERTY(bool isChangingLineVisibilityAllowed READ isChangingLineVisibilityAllowed NOTIFY isChangingLineVisibilityAllowedChanged)
public:
explicit PedalSettingsModel(QObject* parent, IElementRepositoryService* repository);
PropertyItem* lineType() const;
- bool pedalSymbolVisible() const;
bool isChangingLineVisibilityAllowed() const;
-public slots:
- void setPedalSymbolVisible(bool visible);
-
signals:
- void pedalSymbolVisibleChanged();
void isChangingLineVisibilityAllowedChanged();
private:
diff --git a/src/inspector/view/inspector_resources.qrc b/src/inspector/view/inspector_resources.qrc
index df9311ace3689..1e4ebce193f4a 100644
--- a/src/inspector/view/inspector_resources.qrc
+++ b/src/inspector/view/inspector_resources.qrc
@@ -33,6 +33,7 @@
qml/MuseScore/Inspector/common/InspectorSectionView.qml
qml/MuseScore/Inspector/common/SpinBoxPropertyView.qml
qml/MuseScore/Inspector/common/DirectionSection.qml
+ qml/MuseScore/Inspector/notation/lines/internal/PedalStyleSettings.qml
qml/MuseScore/Inspector/notation/lines/internal/HairpinStyleSettings.qml
qml/MuseScore/Inspector/notation/lines/internal/VoltaStyleSettings.qml
qml/MuseScore/Inspector/notation/lines/internal/OttavaStyleSettings.qml
@@ -70,7 +71,6 @@
qml/MuseScore/Inspector/notation/keysignatures/KeySignatureSettings.qml
qml/MuseScore/Inspector/notation/accidentals/AccidentalSettings.qml
qml/MuseScore/Inspector/notation/fretdiagrams/FretDiagramSettings.qml
- qml/MuseScore/Inspector/notation/lines/PedalSettings.qml
qml/MuseScore/Inspector/notation/spacers/SpacerSettings.qml
qml/MuseScore/Inspector/notation/clefs/ClefSettings.qml
qml/MuseScore/Inspector/notation/lines/LineSettings.qml
diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/NotationInspectorSectionLoader.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/NotationInspectorSectionLoader.qml
index 2865eb62c0186..06d63feae1590 100644
--- a/src/inspector/view/qml/MuseScore/Inspector/notation/NotationInspectorSectionLoader.qml
+++ b/src/inspector/view/qml/MuseScore/Inspector/notation/NotationInspectorSectionLoader.qml
@@ -98,9 +98,9 @@ Loader {
case Inspector.TYPE_KEYSIGNATURE: return keySignatureComp
case Inspector.TYPE_ACCIDENTAL: return accidentalComp
case Inspector.TYPE_FRET_DIAGRAM: return fretDiagramComp
- case Inspector.TYPE_PEDAL: return pedalComp
case Inspector.TYPE_SPACER: return spacerComp
case Inspector.TYPE_CLEF: return clefComp
+ case Inspector.TYPE_PEDAL:
case Inspector.TYPE_HAIRPIN:
case Inspector.TYPE_CRESCENDO:
case Inspector.TYPE_DIMINUENDO:
@@ -212,11 +212,6 @@ Loader {
FretDiagramSettings { }
}
- Component {
- id: pedalComp
- PedalSettings { }
- }
-
Component {
id: spacerComp
SpacerSettings { }
diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/LineSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/LineSettings.qml
index 7a282b950a284..730759dc81683 100644
--- a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/LineSettings.qml
+++ b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/LineSettings.qml
@@ -82,6 +82,7 @@ Column {
case Inspector.TYPE_HAIRPIN: return hairpinStyleSettings
case Inspector.TYPE_VOLTA: return voltaStyleSettings
case Inspector.TYPE_OTTAVA: return ottavaStyleSettings
+ case Inspector.TYPE_PEDAL: return pedalStyleSettings
}
return commonStyleSettings
@@ -131,6 +132,17 @@ Column {
}
}
+ Component {
+ id: pedalStyleSettings
+
+ PedalStyleSettings {
+ model: root.model
+
+ navigationPanel: root.navigationPanel
+ navigationRowStart: root.navigationRowStart + 1000
+ }
+ }
+
Component {
id: commonStyleSettings
diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/PedalSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/PedalSettings.qml
deleted file mode 100644
index 188f1b425d476..0000000000000
--- a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/PedalSettings.qml
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * SPDX-License-Identifier: GPL-3.0-only
- * MuseScore-CLA-applies
- *
- * MuseScore
- * Music Composition & Notation
- *
- * Copyright (C) 2021 MuseScore BVBA and others
- *
- * 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 MuseScore.Ui 1.0
-import MuseScore.UiComponents 1.0
-import MuseScore.Inspector 1.0
-
-import "../../common"
-import "internal"
-
-Column {
- id: root
-
- property QtObject model: null
-
- property NavigationPanel navigationPanel: null
- property int navigationRowStart: 1
-
- objectName: "PedalSettings"
-
- spacing: 12
-
- function focusOnFirst() {
- showPedalSymbol.navigation.requestActive()
- }
-
- CheckBox {
- id: showPedalSymbol
- width: parent.width
- text: qsTrc("inspector", "Show pedal symbol")
-
- navigation.name: "ShowPedalSymbolCheckBox"
- navigation.panel: root.navigationPanel
- navigation.row: root.navigationRowStart
-
- checked: root.model && root.model.pedalSymbolVisible
- onClicked: {
- root.model.pedalSymbolVisible = !checked
- }
- }
-
- HooksSection {
- id: hooksSection
-
- startHookType: root.model ? root.model.startHookType : null
- endHookType: root.model ? root.model.lineType : null
- startHookHeight: root.model ? root.model.startHookHeight : null
- endHookHeight: root.model ? root.model.endHookHeight : null
-
- possibleStartHookTypes: root.model ? root.model.possibleStartHookTypes() : null
- possibleEndHookTypes: root.model ? root.model.possibleEndHookTypes() : null
-
- navigationPanel: root.navigationPanel
- navigationRowStart: root.navigationRowStart + 1
- }
-
- PropertyCheckBox {
- id: showLineCheckBox
- visible: root.model && root.model.isChangingLineVisibilityAllowed
-
- text: qsTrc("inspector", "Show line with rosette")
- propertyItem: root.model ? root.model.isLineVisible : null
-
- navigation.name: "ShowLineWithRosetteCheckBox"
- navigation.panel: root.navigationPanel
- navigation.row: hooksSection.navigationRowEnd + 1
- }
-
- SeparatorLine { anchors.margins: -12 }
-
- LineStyleSection {
- thickness: root.model ? root.model.thickness : null
-
- lineStyle: root.model ? root.model.lineStyle : null
- dashLineLength: root.model ? root.model.dashLineLength : null
- dashGapLength: root.model ? root.model.dashGapLength : null
-
- navigationPanel: root.navigationPanel
- navigationRowStart: showLineCheckBox.navigation.row + 1
- }
-}
diff --git a/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/PedalStyleSettings.qml b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/PedalStyleSettings.qml
new file mode 100644
index 0000000000000..d0c5964e968e7
--- /dev/null
+++ b/src/inspector/view/qml/MuseScore/Inspector/notation/lines/internal/PedalStyleSettings.qml
@@ -0,0 +1,90 @@
+/*
+ * SPDX-License-Identifier: GPL-3.0-only
+ * MuseScore-CLA-applies
+ *
+ * MuseScore
+ * Music Composition & Notation
+ *
+ * Copyright (C) 2021 MuseScore BVBA and others
+ *
+ * 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 MuseScore.Ui 1.0
+import MuseScore.UiComponents 1.0
+import MuseScore.Inspector 1.0
+
+import "../../../common"
+
+FocusableItem {
+ id: root
+
+ property QtObject model: null
+
+ property NavigationPanel navigationPanel: null
+ property int navigationRowStart: 1
+
+ implicitHeight: contentColumn.height
+ width: parent.width
+
+
+ Column {
+ id: contentColumn
+
+ width: parent.width
+
+ spacing: 12
+
+ HooksSection {
+ id: hooksSection
+
+ startHookType: root.model ? root.model.startHookType : null
+ endHookType: root.model ? root.model.lineType : null
+ startHookHeight: root.model ? root.model.startHookHeight : null
+ endHookHeight: root.model ? root.model.endHookHeight : null
+
+ possibleStartHookTypes: root.model ? root.model.possibleStartHookTypes() : null
+ possibleEndHookTypes: root.model ? root.model.possibleEndHookTypes() : null
+
+ navigationPanel: root.navigationPanel
+ navigationRowStart: root.navigationRowStart + 1
+ }
+
+ PropertyCheckBox {
+ id: showLineCheckBox
+ visible: root.model && root.model.isChangingLineVisibilityAllowed
+
+ text: qsTrc("inspector", "Show line with rosette")
+ propertyItem: root.model ? root.model.isLineVisible : null
+
+ navigation.name: "ShowLineWithRosetteCheckBox"
+ navigation.panel: root.navigationPanel
+ navigation.row: hooksSection.navigationRowEnd + 1
+ }
+
+ SeparatorLine { anchors.margins: -12 }
+
+ LineStyleSection {
+ thickness: root.model ? root.model.thickness : null
+
+ lineStyle: root.model ? root.model.lineStyle : null
+ dashLineLength: root.model ? root.model.dashLineLength : null
+ dashGapLength: root.model ? root.model.dashGapLength : null
+
+ navigationPanel: root.navigationPanel
+ navigationRowStart: showLineCheckBox.navigation.row + 1
+ }
+ }
+}
\ No newline at end of file