Skip to content

Commit 74c944a

Browse files
committed
add placement option back
1 parent 80f2332 commit 74c944a

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

harmonica_tablature.qml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,20 @@ MuseScore {
9999
harp.tuning = harp.get(currentIndex).tuning
100100
}
101101
}
102-
// ComboBox {
103-
// currentIndex: 1
104-
// model: ListModel {
105-
// id: placetext
106-
// property var position
107-
// ListElement { text: "Above staff"; position: "above" }
108-
// ListElement { text: "Below staff"; position: "below" }
109-
// }
110-
// width: 100
111-
// onCurrentIndexChanged: {
112-
// console.debug(placetext.get(currentIndex).text + ", " + placetext.get(currentIndex).position)
113-
// placetext.position = placetext.get(currentIndex).position
114-
// }
115-
// }
102+
ComboBox {
103+
currentIndex: 1
104+
model: ListModel {
105+
id: placetext
106+
property var position
107+
ListElement { text: "Above staff"; position: "above" }
108+
ListElement { text: "Below staff"; position: "below" }
109+
}
110+
width: 100
111+
onCurrentIndexChanged: {
112+
console.debug(placetext.get(currentIndex).text + ", " + placetext.get(currentIndex).position)
113+
placetext.position = placetext.get(currentIndex).position
114+
}
115+
}
116116
}
117117
RowLayout {
118118
anchors.horizontalCenter: parent.horizontalCenter
@@ -252,9 +252,8 @@ MuseScore {
252252
var endStaff;
253253
var endTick;
254254
var fullScore = false;
255-
// TODO : deal with placement
256-
//var textposition = placetext.position
257-
//console.log("textposition set to " + placetext.position)
255+
256+
var textposition = (placetext.position === "above" ? Placement.ABOVE : Placement.BELOW);
258257

259258
cursor.rewind(1);
260259
if (!cursor.segment) { // no selection
@@ -296,13 +295,16 @@ MuseScore {
296295
var notes = graceChords[i].notes;
297296
tabNotes(notes, text);
298297
// TODO: deal with placement of grace note on the x axis
298+
text.placement = textposition
299+
text.offset = Qt.point(-40, 0)
299300
cursor.add(text);
300301
// new text for next element
301302
text = newElement(Element.STAFF_TEXT);
302303
}
303304

304305
var notes = cursor.element.notes;
305306
tabNotes(notes, text);
307+
text.placement = textposition
306308

307309
cursor.add(text);
308310
} // end if CHORD

0 commit comments

Comments
 (0)