Skip to content

Commit

Permalink
Added text tab to pedal line properties (musescore#14928)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakajikara committed Jul 5, 2023
1 parent 48c75f4 commit 70b94d9
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 128 deletions.
14 changes: 0 additions & 14 deletions src/inspector/models/notation/lines/pedalsettingsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
});
Expand Down
6 changes: 0 additions & 6 deletions src/inspector/models/notation/lines/pedalsettingsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
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 @@ -33,6 +33,7 @@
<file>qml/MuseScore/Inspector/common/InspectorSectionView.qml</file>
<file>qml/MuseScore/Inspector/common/SpinBoxPropertyView.qml</file>
<file>qml/MuseScore/Inspector/common/DirectionSection.qml</file>
<file>qml/MuseScore/Inspector/notation/lines/internal/PedalStyleSettings.qml</file>
<file>qml/MuseScore/Inspector/notation/lines/internal/HairpinStyleSettings.qml</file>
<file>qml/MuseScore/Inspector/notation/lines/internal/VoltaStyleSettings.qml</file>
<file>qml/MuseScore/Inspector/notation/lines/internal/OttavaStyleSettings.qml</file>
Expand Down Expand Up @@ -70,7 +71,6 @@
<file>qml/MuseScore/Inspector/notation/keysignatures/KeySignatureSettings.qml</file>
<file>qml/MuseScore/Inspector/notation/accidentals/AccidentalSettings.qml</file>
<file>qml/MuseScore/Inspector/notation/fretdiagrams/FretDiagramSettings.qml</file>
<file>qml/MuseScore/Inspector/notation/lines/PedalSettings.qml</file>
<file>qml/MuseScore/Inspector/notation/spacers/SpacerSettings.qml</file>
<file>qml/MuseScore/Inspector/notation/clefs/ClefSettings.qml</file>
<file>qml/MuseScore/Inspector/notation/lines/LineSettings.qml</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -212,11 +212,6 @@ Loader {
FretDiagramSettings { }
}

Component {
id: pedalComp
PedalSettings { }
}

Component {
id: spacerComp
SpacerSettings { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -131,6 +132,17 @@ Column {
}
}

Component {
id: pedalStyleSettings

PedalStyleSettings {
model: root.model

navigationPanel: root.navigationPanel
navigationRowStart: root.navigationRowStart + 1000
}
}

Component {
id: commonStyleSettings

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
*/
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
}
}
}

0 comments on commit 70b94d9

Please sign in to comment.