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

Fix scordature scaling for better rendering

- do not create invisible components
- update note name style when changed
parent 30a3f19d
No related branches found
No related tags found
No related merge requests found
Pipeline #2868 passed
......@@ -126,13 +126,11 @@ Score {
onScordatureChanged: updateScord()
}
function updateScord() {
if (scordature) {
if (scordature)
scordature.destroy()
scordature = null
}
if (GLOB.tuning.scordature && GLOB.instrument.isGuitar && GLOB.instrument.type !== Tinstrument.BassGuitar) {
scordature = Qt.createComponent("qrc:/score/Scordature.qml").createObject(firstStaff)
firstStaff.scordSpace = scordature.height
firstStaff.scordSpace = scordature.height * scordature.scale * (clef === Tclef.PianoStaffClefs ? 1 : 1.2)
} else
firstStaff.scordSpace = 0
}
......
......@@ -12,26 +12,40 @@ Grid {
y: upperLine + 14 + (score.clef === Tclef.PianoStaffClefs ? 18 : 0)
x: 0.5
spacing: 0.5
scale: columns > 1 ? 0.75 : (score.clef === Tclef.PianoStaffClefs ? 1.4 : 1.2)
scale: columns > 1 ? 0.2 : (score.clef === Tclef.PianoStaffClefs ? 0.35 : 0.3)
transformOrigin: Item.TopLeft
columns: GLOB.tuning.changedStrings() > 3 ? 2 : 1
visible: score.clef !== Tclef.NoClef
Repeater {
model: 6
Row {
visible: GLOB.tuning.otherThanStd(index + 1)
height: 2
model: ListModel { id: scordModel }
delegate: Row {
height: 12
Text {
text: (index + 1)
font { pixelSize: 3; family: "Nootka" }
text: scordModel.count ? scordModel.get(index).strNr : ""
font { pixelSize: 12; family: "Nootka" }
anchors.verticalCenter: parent.verticalCenter
}
Text {
topPadding: 1.9
text: "=" + GLOB.tuning.stringName(index + 1)
font { pixelSize: 2; family: "Scorek" }
topPadding: 3.5
text: "=" + (scordModel.count ? scordModel.get(index).name : "")
font { pixelSize: 8; family: "Scorek" }
anchors.verticalCenter: parent.verticalCenter
}
}
}
Component.onCompleted: updateScordature()
Connections {
target: GLOB
onNoteNameStyleChanged: updateScordature()
}
function updateScordature() {
scordModel.clear()
for (var s = 0; s < 6; ++s) {
if (GLOB.tuning.otherThanStd(s + 1))
scordModel.append({ "strNr": s + 1, "name": GLOB.tuning.stringName(s + 1) })
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment