forked from musescore/MuseScore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix musescore#13761: Implement Lyrics Properties in Inspector
- Loading branch information
1 parent
644cc12
commit 9a05f80
Showing
11 changed files
with
186 additions
and
2 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -377,6 +377,7 @@ class IconCode | |
TEMPO_CHANGE = 0xF43F, | ||
|
||
PLUGIN = 0xF440, | ||
LYRICS = 0xF441, | ||
|
||
NONE = 0xFFFF | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/inspector/models/notation/lyrics/lyricssettingsmodel.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* 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/>. | ||
*/ | ||
#include "lyricssettingsmodel.h" | ||
|
||
#include "translation.h" | ||
|
||
using namespace mu::inspector; | ||
|
||
LyricsSettingsModel::LyricsSettingsModel(QObject* parent, IElementRepositoryService* repository) | ||
: AbstractInspectorModel(parent, repository) | ||
{ | ||
setModelType(InspectorModelType::TYPE_LYRICS); | ||
setTitle(qtrc("inspector", "Lyrics")); | ||
setIcon(ui::IconCode::Code::LYRICS); | ||
createProperties(); | ||
} | ||
|
||
void LyricsSettingsModel::createProperties() | ||
{ | ||
m_verse = buildPropertyItem(mu::engraving::Pid::VERSE); | ||
} | ||
|
||
void LyricsSettingsModel::requestElements() | ||
{ | ||
m_elementList = m_repository->findElementsByType(mu::engraving::ElementType::LYRICS); | ||
} | ||
|
||
void LyricsSettingsModel::loadProperties() | ||
{ | ||
loadPropertyItem(m_verse); | ||
} | ||
|
||
void LyricsSettingsModel::resetProperties() | ||
{ | ||
m_verse->resetToDefault(); | ||
} | ||
|
||
PropertyItem* LyricsSettingsModel::verse() const | ||
{ | ||
return m_verse; | ||
} |
48 changes: 48 additions & 0 deletions
48
src/inspector/models/notation/lyrics/lyricssettingsmodel.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* 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/>. | ||
*/ | ||
#ifndef MU_INSPECTOR_LYRICSSETTINGSMODEL_H | ||
#define MU_INSPECTOR_LYRICSSETTINGSMODEL_H | ||
|
||
#include "models/abstractinspectormodel.h" | ||
|
||
namespace mu::inspector { | ||
class LyricsSettingsModel : public AbstractInspectorModel | ||
{ | ||
Q_OBJECT | ||
|
||
Q_PROPERTY(PropertyItem * verse READ verse CONSTANT) | ||
public: | ||
explicit LyricsSettingsModel(QObject* parent, IElementRepositoryService* repository); | ||
|
||
void createProperties() override; | ||
void requestElements() override; | ||
void loadProperties() override; | ||
void resetProperties() override; | ||
|
||
PropertyItem* verse() const; | ||
|
||
private: | ||
PropertyItem* m_verse = nullptr; | ||
}; | ||
} | ||
|
||
#endif // MU_INSPECTOR_LYRICSSETTINGSMODEL_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/inspector/view/qml/MuseScore/Inspector/notation/lyrics/LyricsSettings.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* 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" | ||
|
||
Column { | ||
id: root | ||
|
||
property QtObject model: null | ||
|
||
property NavigationPanel navigationPanel: null | ||
property int navigationRowStart: 1 | ||
|
||
objectName: "LyricsSettings" | ||
|
||
spacing: 12 | ||
|
||
function focusOnFirst() { | ||
setVerse.focusOnFirst() | ||
} | ||
|
||
SpinBoxPropertyView { | ||
id: setVerse | ||
titleText: qsTrc("inspector", "Set to verse") | ||
propertyItem: root.model ? root.model.verse : null | ||
|
||
decimals: 0 | ||
step: 1 | ||
minValue: 1 | ||
|
||
navigationName: "SpanFrom" | ||
navigationPanel: root.navigationPanel | ||
navigationRowStart: root.navigationRowStart | ||
} | ||
} |