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

Use proper JS syntax for Connections

parent f5028035
No related branches found
No related tags found
No related merge requests found
...@@ -134,7 +134,7 @@ Score { ...@@ -134,7 +134,7 @@ Score {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
//z: -1 //z: -1
onWheel: { onWheel: wheel => {
if (wheel.modifiers & Qt.ControlModifier) { if (wheel.modifiers & Qt.ControlModifier) {
if (wheel.angleDelta.y > 0) if (wheel.angleDelta.y > 0)
zoom(true); zoom(true);
......
...@@ -12,6 +12,7 @@ ApplicationWindow { ...@@ -12,6 +12,7 @@ ApplicationWindow {
property bool topToBott: height > width property bool topToBott: height > width
property real shortEdge: Math.min(height, width * (GLOB.instrument.isSax ? 0.85 : 1)) property real shortEdge: Math.min(height, width * (GLOB.instrument.isSax ? 0.85 : 1))
property alias mainMenu: mainMenu property alias mainMenu: mainMenu
// private // private
property var noteName: null property var noteName: null
property var examResults: null property var examResults: null
...@@ -80,6 +81,7 @@ ApplicationWindow { ...@@ -80,6 +81,7 @@ ApplicationWindow {
x: GLOB.geometry.x x: GLOB.geometry.x
y: GLOB.geometry.y y: GLOB.geometry.y
header: mainMenu.toolBar header: mainMenu.toolBar
Component.onCompleted: { Component.onCompleted: {
NOO.mainScore = score; NOO.mainScore = score;
checkSingleMode(); checkSingleMode();
...@@ -95,7 +97,8 @@ ApplicationWindow { ...@@ -95,7 +97,8 @@ ApplicationWindow {
createStatus(); createStatus();
} }
} }
onClosing: {
onClosing: close => {
if (NOO.isAndroid() && dialogLoader && dialogLoader.visible) { if (NOO.isAndroid() && dialogLoader && dialogLoader.visible) {
close.accepted = false; close.accepted = false;
dialogLoader.close(); dialogLoader.close();
...@@ -103,7 +106,6 @@ ApplicationWindow { ...@@ -103,7 +106,6 @@ ApplicationWindow {
if (executor) { if (executor) {
if (!executor.closeNootka()) if (!executor.closeNootka())
close.accepted = false; close.accepted = false;
} }
if (close.accepted) if (close.accepted)
GLOB.geometry = Qt.rect(x, y, width, height); GLOB.geometry = Qt.rect(x, y, width, height);
...@@ -114,25 +116,23 @@ ApplicationWindow { ...@@ -114,25 +116,23 @@ ApplicationWindow {
id: activPal id: activPal
property color dimText: Qt.tint(activPal.base, NOO.alpha(activPal.text, 150)) property color dimText: Qt.tint(activPal.base, NOO.alpha(activPal.text, 150))
colorGroup: SystemPalette.Active colorGroup: SystemPalette.Active
} }
SystemPalette { SystemPalette {
id: disdPal id: disdPal
colorGroup: SystemPalette.Disabled colorGroup: SystemPalette.Disabled
} }
Connections { Connections {
target: NOO target: NOO
onScoreActTriggered: mainMenu.open() function onScoreActTriggered() : void { mainMenu.open() }
onMelodyActTriggered: mainMenu.melodyOpen() function onMelodyActTriggered() : void { mainMenu.melodyOpen() }
onSettingsActTriggered: showDialog(Nootka.Settings) function onSettingsActTriggered() : void { showDialog(Nootka.Settings) }
onLevelActTriggered: showDialog(Nootka.LevelCreator) function onLevelActTriggered() : void { showDialog(Nootka.LevelCreator) }
onChartsActTriggered: showDialog(Nootka.Charts) function onChartsActTriggered() : void { showDialog(Nootka.Charts) }
onExamActTriggered: showDialog(Nootka.ExamStart) function onExamActTriggered() : void { showDialog(Nootka.ExamStart) }
onAboutActTriggered: showDialog(Nootka.About) function onAboutActTriggered() : void { showDialog(Nootka.About) }
} }
MainMenu { MainMenu {
...@@ -168,34 +168,29 @@ ApplicationWindow { ...@@ -168,34 +168,29 @@ ApplicationWindow {
Connections { Connections {
target: GLOB target: GLOB
onSingleNoteModeChanged: checkSingleMode() function onSingleNoteModeChanged() : void { checkSingleMode() }
onIsExamChanged: { function onIsExamChanged() : void {
if (GLOB.isExam) { if (GLOB.isExam) {
if (!executor) if (!executor)
executor = Qt.createComponent("qrc:/exam/ExamExecutor.qml").createObject(); executor = Qt.createComponent("qrc:/exam/ExamExecutor.qml").createObject();
if (!examResults) if (!examResults)
examResults = Qt.createComponent("qrc:/exam/ExamResults.qml").createObject(nootkaWindow.contentItem); examResults = Qt.createComponent("qrc:/exam/ExamResults.qml").createObject(nootkaWindow.contentItem);
} else { } else {
if (examResults) if (examResults)
examResults.destroy(); examResults.destroy();
} }
} }
onWantOpenFile: { function onWantOpenFile() : void {
showDialog(Nootka.NoDialog); showDialog(Nootka.NoDialog);
dialogLoader.openFile(fileName); dialogLoader.openFile(fileName);
} }
onShowNotesDiffChanged: { function onShowNotesDiffChanged() : void {
if (GLOB.showNotesDiff) { if (GLOB.showNotesDiff) {
if (!notesBarItem) if (!notesBarItem)
notesBarItem = Qt.createComponent("qrc:/sound/NotesDiffBar.qml").createObject(nootkaWindow.contentItem); notesBarItem = Qt.createComponent("qrc:/sound/NotesDiffBar.qml").createObject(nootkaWindow.contentItem);
} else { } else {
if (notesBarItem) if (notesBarItem)
notesBarItem.destroy(); notesBarItem.destroy();
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment