Commit bfcdd815 authored by SeeLook's avatar SeeLook 🎸
Browse files

Expose option in score menu to switch displaying notes diff

- prepare_build
parent ded8bf21
Pipeline #4185 passed with stage
in 7 minutes and 50 seconds
......@@ -95,6 +95,15 @@ TmainScoreObject::TmainScoreObject(QObject* parent) :
m_notesMenuAct = new Taction(tr("notes", "musical notes of course") + QStringLiteral(" ⋮"), QStringLiteral("score"), this);
m_reviewModeAct = new Taction(tr("Review mode"), QString(), this);
m_reviewModeAct->setCheckable(true);
m_reviewModeAct->setChecked(GLOB->showNotesDiff());
m_reviewModeAct->setTip(tr("Do not change score when playing on instrument and display bar to see selected and played notes."));
connect(m_reviewModeAct, &Taction::triggered, this, [=]{
m_reviewModeAct->setChecked(!m_reviewModeAct->checked());
GLOB->setShowNotesDiff(m_reviewModeAct->checked());
});
QQmlComponent actionsComp(NOO->qmlEngine(), this);
m_openXmlAct->createQmlShortcut(&actionsComp, "StandardKey.Open; enabled: !GLOB.singleNoteMode && !GLOB.isExam");
m_saveXmlAct->createQmlShortcut(&actionsComp, "StandardKey.Save; enabled: !GLOB.singleNoteMode && !GLOB.isExam");
......@@ -166,6 +175,7 @@ void TmainScoreObject::setScoreObject(TscoreObject* scoreObj) {
});
m_scoreObj->clearScoreAct()->setBgColor(QColor(255, 140, 0)); // orange
#if !defined (Q_OS_ANDROID)
m_scoreActions.prepend(m_reviewModeAct);
m_scoreActions.prepend(m_scoreObj->editModeAct());
m_scoreActions << m_scoreObj->insertNoteAct() << m_scoreObj->deleteNoteAct()
<< m_scoreObj->clearScoreAct() << m_transposeAct << m_notesMenuAct;
......@@ -594,6 +604,7 @@ void TmainScoreObject::isExamChangedSlot() {
}
if (m_scoreObj) {
#if !defined (Q_OS_ANDROID)
m_scoreActions.prepend(m_reviewModeAct);
m_scoreActions.prepend(m_scoreObj->editModeAct());
m_scoreActions << m_scoreObj->insertNoteAct() << m_scoreObj->deleteNoteAct()
<< m_scoreObj->clearScoreAct() << m_transposeAct << m_notesMenuAct;
......
......@@ -64,6 +64,7 @@ class TmainScoreObject : public QObject
Q_PROPERTY(Taction* randMelodyAct READ randMelodyAct)
Q_PROPERTY(Taction* notesMenuAct READ notesMenuAct)
Q_PROPERTY(Taction* transposeAct READ transposeAct)
Q_PROPERTY(Taction* reviewModeAct READ reviewModeAct)
Q_PROPERTY(QList<QObject*> melodyActions READ melodyActions NOTIFY melodyActionsChanged)
Q_PROPERTY(QString keyNameText READ keyNameText NOTIFY keyNameTextChanged)
Q_PROPERTY(QQuickItem* mainScoreItem READ mainScoreItem WRITE setMainScoreItem)
......@@ -96,6 +97,7 @@ public:
Taction* saveXmlAct() { return m_saveXmlAct; }
Taction* randMelodyAct() { return m_randMelodyAct; }
Taction* notesMenuAct() { return m_notesMenuAct; }
Taction* reviewModeAct() { return m_reviewModeAct; }
QList<QObject*> melodyActions() { return m_melodyActions; }
......@@ -210,6 +212,7 @@ private:
Taction *m_openXmlAct, *m_saveXmlAct, *m_randMelodyAct;
Taction *m_nextNoteAct, *m_prevNoteAct;
Taction *m_notesMenuAct = nullptr;
Taction *m_reviewModeAct = nullptr;
QList<QObject*> m_scoreActions;
QList<QObject*> m_noteActions;
QList<QObject*> m_melodyActions;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment