Skip to content
Snippets Groups Projects
Commit a436bb03 authored by SeeLook's avatar SeeLook :musical_note:
Browse files

After clearing a score - rewind flickable position to start

- otherwise 1st staff may left invisible
- use unused so far signal scoreWasCleared() but invoke it first
parent 7a86a5e2
No related branches found
No related tags found
No related merge requests found
Pipeline #3183 skipped
......@@ -999,6 +999,7 @@ void TscoreObject::clearScore() {
emit scoreWasCleared();
}
setKeySignature(0);
emit scoreWasCleared();
}
......
......@@ -57,6 +57,7 @@ Flickable {
TscoreObject {
id: scoreObj
width: score.width / scale
enableDoubleAccidentals: score.enableDoubleAccids
onClicked: currentNote = scoreObj.activeNote
......@@ -65,12 +66,16 @@ Flickable {
staves.push(Qt.createComponent("qrc:/score/Staff.qml").createObject(score.contentItem))
score.lastStaff = staves[staves.length - 1]
}
onStavesHeightChanged: score.contentHeight = Math.max(stavesHeight, score.height)
onStaffDestroying: { staves.splice(staffNr, 1); lastStaff = staves[staves.length - 1] }
onNoteWasAdded: {
if (staves.length > 1)
ensureVisible(lastNote.staffItem.y, lastNote.staffItem.height * scale)
}
onAllowAddingChanged: {
if (allowAdding) {
if (!delControl)
......@@ -81,6 +86,7 @@ Flickable {
scoreToobox = Qt.createComponent("qrc:/score/ScoreToolbox.qml").createObject(parent)
}
}
onActiveNoteChanged: {
if (!cursor) {
cursor = Qt.createComponent("qrc:/score/ScoreCursor.qml").createObject(contentItem)
......@@ -89,6 +95,8 @@ Flickable {
if (!scoreToobox && !readOnly)
scoreToobox = Qt.createComponent("qrc:/score/ScoreToolbox.qml").createObject(parent)
}
onScoreWasCleared: ensureVisible(0, 0)
}
onCurrentNoteChanged: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment