diff --git a/src/qml/MainScore.qml b/src/qml/MainScore.qml index 8355e808a3c0e9a5eb1d74afddf8b29caf757e5f..34255df2c237c8eba264cf906f93f4198c7f2ead 100644 --- a/src/qml/MainScore.qml +++ b/src/qml/MainScore.qml @@ -25,7 +25,7 @@ Score { property alias recModeAct: recModeAct property alias playAct: playAct - scoreObj.meter: GLOB.rhythmsEnabled ? Tmeter.Meter_4_4 : Tmeter.NoMeter + scoreObj.meter: GLOB.rhythmsEnabled && !GLOB.singleNoteMode ? Tmeter.Meter_4_4 : Tmeter.NoMeter focus: true onFocusChanged: { @@ -41,7 +41,8 @@ Score { scoreObj.nameColor: GLOB.nameColor scoreObj.nameStyle: GLOB.noteNameStyle scoreObj.enableDoubleAccidentals: GLOB.enableDoubleAccids - scoreObj.allowAdding: true + scoreObj.allowAdding: !GLOB.singleNoteMode + Timer { id: zoomTimer; interval: 500 } MouseArea { @@ -73,15 +74,27 @@ Score { color: activPal.text font { family: "Sans"; pointSize: 1.5 } text: getKeyNameText() - Connections { - target: GLOB - onKeyNameChanged: keyName.text = Qt.binding(keyName.getKeyNameText) - } function getKeyNameText() { return enableKeySign && firstStaff.keySignature ? Noo.majAndMinKeyName(firstStaff.keySignature.key) : "" } } + Component.onCompleted: { + scoreObj.singleNote = GLOB.singleNoteMode + } + + Connections { + target: GLOB + onKeyNameChanged: keyName.text = Qt.binding(keyName.getKeyNameText) + onSingleNoteModeChanged: { + scoreObj.singleNote = GLOB.singleNoteMode + if (GLOB.singleNoteMode) { + recordMode = false + scoreObj.note(1).visible = Qt.binding(function() { return GLOB.showEnharmNotes }) + scoreObj.note(2).visible = Qt.binding(function() { return GLOB.showEnharmNotes && GLOB.enableDoubleAccids }) + } + } + } Rectangle { // note highlight id: noteHighlight @@ -134,11 +147,13 @@ Score { } Taction { id: extraAccidsAct + enabled: !GLOB.singleNoteMode text: qsTr("Additional accidentals") checkable: true } Taction { id: showNamesAct + enabled: !GLOB.singleNoteMode text: qsTr("Show note names") checkable: true checked: GLOB.namesOnScore @@ -146,6 +161,7 @@ Score { } Taction { id: zoomOutAct + enabled: !GLOB.singleNoteMode icon: "zoom-out" text: qsTr("Zoom score out") onTriggered: scaleFactor = Math.max(0.4, scaleFactor - 0.2) @@ -153,6 +169,7 @@ Score { } Taction { id: zoomInAct + enabled: !GLOB.singleNoteMode icon: "zoom-in" text: qsTr("Zoom score in") onTriggered: scaleFactor = scaleFactor = Math.min(scaleFactor + 0.2, 1.4) @@ -160,6 +177,7 @@ Score { } Taction { id: deleteLastAct + enabled: !GLOB.singleNoteMode icon: "delete" text: qsTr("Delete note") onTriggered: scoreObj.deleteLastNote() @@ -167,6 +185,7 @@ Score { } Taction { id: clearScoreAct + enabled: !GLOB.singleNoteMode icon: "clear-score" text: qsTr("Delete all notes") onTriggered: clearScore() @@ -174,6 +193,7 @@ Score { } Shortcut { + enabled: !GLOB.singleNoteMode sequence: StandardKey.MoveToNextChar; onActivated: { if (currentNote) @@ -183,6 +203,7 @@ Score { } } Shortcut { + enabled: !GLOB.singleNoteMode sequence: StandardKey.MoveToPreviousChar; onActivated: { if (currentNote) @@ -192,6 +213,7 @@ Score { } } Keys.onSpacePressed: { + enabled: !GLOB.singleNoteMode if (event.modifiers & Qt.ControlModifier) recModeAct.triggered() else diff --git a/src/qml/NoteName.qml b/src/qml/NoteName.qml index dbb70626fdd60522a8ae6c996a02f0c8be3061c6..9c97de710e3cd2fe08c705b9614a68d077894ae6 100644 --- a/src/qml/NoteName.qml +++ b/src/qml/NoteName.qml @@ -11,6 +11,8 @@ import Nootka.name 1.0 TnameItem { id: noteName + nameStyle: GLOB.noteNameStyle + // private property real buttHeight: height / 12 property real buttWidth: width / 9 @@ -65,6 +67,7 @@ TnameItem { Repeater { model: [ "B", "b", "#", "x" ] TcuteButton { + visible: GLOB.enableDoubleAccids || (index > 0 && index < 3) width: buttWidth height: buttHeight * 1.1 checkable: step > 0 diff --git a/src/qml/score/AddLine.qml b/src/qml/score/AddLine.qml index 248842f6726327c5b1fca7251d910dbb97aeabd4..e0c4ca0f1e6c1d7d726f150578ff0ab0b66e97e7 100644 --- a/src/qml/score/AddLine.qml +++ b/src/qml/score/AddLine.qml @@ -5,7 +5,7 @@ import QtQuick 2.9 Rectangle { - x: - 1.0 + x: score.singleNote ? 0.5 : - 1.0 height: 0.2 width: 4.0 color: noteCursor.color diff --git a/src/qml/score/NoteCursor.qml b/src/qml/score/NoteCursor.qml index 6b486f7515910c9de0a1e3ee44c9197e8e5c0f1c..3c7db0123487d9fe6968e2161d1c69f4816f6df4 100644 --- a/src/qml/score/NoteCursor.qml +++ b/src/qml/score/NoteCursor.qml @@ -11,7 +11,7 @@ Item { id: noteCursor height: parent ? parent.height : 0 - width: parent ? parent.width - parent.alterWidth : 0 + width: parent ? parent.width - (score.singleNote ? 0 : parent.alterWidth) : 0 property alias headText: head.text property color color: GLOB.noteCursorColor @@ -35,12 +35,13 @@ Item { text: "\uf4be" y: yPos - 15 color: noteCursor.color + x: score.singleNote ? 1.5 : 0 Text { id: alter font { family: "Scorek"; pixelSize: 7 } color: noteCursor.color - x: head.x - width - 0.1 + x: -width - 0.1 } } diff --git a/src/qml/score/Score.qml b/src/qml/score/Score.qml index fa7c40878049fda7725f1cd01c2599b5b96fbea1..ae05d1dcd699e142de6bc9ef4e8f437fea225529 100644 --- a/src/qml/score/Score.qml +++ b/src/qml/score/Score.qml @@ -26,6 +26,7 @@ Flickable { property alias currentNote: scoreObj.selectedItem property alias note: scoreObj.selectedNote property alias readOnly: scoreObj.readOnly + property alias singleNote: scoreObj.singleNote property bool recordMode: false // private diff --git a/src/qml/score/Staff.qml b/src/qml/score/Staff.qml index 4b1963b829b38828ac03e92d9339b5b41e8c8164..08ba9b6d01f7117e6207e86ad50eb3757213755a 100644 --- a/src/qml/score/Staff.qml +++ b/src/qml/score/Staff.qml @@ -23,7 +23,8 @@ Item { signal destroing(var nr) height: linesCount - scale: (Math.min(score.height, Math.max(Screen.height / 4, Screen.pixelDensity * 70)) / linesCount) * score.scaleFactor + scale: score.singleNote ? score.height / linesCount : + (Math.min(score.height, Math.max(Screen.height / 4, Screen.pixelDensity * 70)) / linesCount) * score.scaleFactor width: score.width / scale transformOrigin: Item.TopLeft