Newer
Older
/** This file is part of Nootka (http://nootka.sf.net) *
* Copyright (C) 2017-2021 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
import QtQuick 2.12
import QtQuick.Controls 2.12
property var rGlyphs: ["#", "b", "C", "D", "E", "F", "G", "\ue109", ".", "\ue18c"]
x: NOO.isAndroid() ? (nootkaWindow.width - width) / 2 : toolBar.scoreAct.x
y: NOO.isAndroid() ? (nootkaWindow.height - height) / 2 : score.y
onAboutToShow: SOUND.stopListen()
onAboutToHide: SOUND.startListen()
Repeater {
model: score.scoreActions
MenuItem {
padding: 0
width: menu.width
enabled: modelData.enabled
contentItem: MenuButton {
action: modelData
onClicked: close()
Rectangle {
width: parent.width
height: index === score.scoreActions.length - 1 ? 0 : 1
color: activPal.text
y: parent.height - 1
}
}
}
notesLoader.active = true;
notesLoader.item.open();
close();
}
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
Loader {
id: notesLoader
sourceComponent: notesComp
active: false
}
Component {
id: notesComp
Tmenu {
id: noteMenu
parent: menu.parent
x: menu.x + menu.width / 4
y: score.y + menu.width / 8
Repeater {
model: score.noteActions
MenuItem {
padding: 0
width: menu.width
contentItem: MenuButton {
id: mb
action: modelData
onClicked: close()
Rectangle {
width: parent.width
height: index === score.noteActions.length - 1 ? 0 : 1
color: activPal.text
y: parent.height - 1
}
Text {
text: rGlyphs[index]
color: activPal.text
x: (NOO.factor() * 3.2 - width) / 2
anchors.verticalCenter: parent.verticalCenter
scale: GLOB.useAnimations && !mb.containsPress && mb.containsMouse ? 1.4 : 1
font {
pixelSize: NOO.factor() * 1.5
family: "nootka"
}
Behavior on scale {
enabled: GLOB.useAnimations
NumberAnimation {
duration: 150
}
}
}
}
}
}
}
}
Connections {
target: score.transposeAct
function onTriggered() : void {
let tPop = transComp.createObject(nootkaWindow);
tPop.initKey = score.keySignature;
close();
}
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
Component {
id: transComp
TpopupDialog {
id: transPopup
property alias initKey: transpose.initialKey
visible: true
modal: true
width: transpose.width + NOO.factor()
height: transpose.height + NOO.factor() * 8
caption: NOO.TR("Transpose", "Transpose")
onClosed: destroy()
onAccepted: {
if (transpose.toKey || transpose.byInterval) {
if (transpose.toKey)
score.keySignature = transpose.selectedKey;
var sObj = score.scoreObj;
sObj.transpose(transpose.outShift, transpose.outScaleToRest, transpose.inInstrumentScale ? GLOB.loNote() : sObj.lowestNote(), transpose.inInstrumentScale ? GLOB.hiNote() : sObj.highestNote());
}
}
Transpose {
id: transpose
headerVisible: false
}