diff --git a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/ChooseInstrumentsPage.qml b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/ChooseInstrumentsPage.qml index 382bb0eb1e47e..380c6f1eaa787 100644 --- a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/ChooseInstrumentsPage.qml +++ b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/ChooseInstrumentsPage.qml @@ -39,6 +39,8 @@ Rectangle { property NavigationSection navigationSection: null + signal submitRequested() + function instruments() { if (root.canSelectMultipleInstruments) { return instrumentsOnScoreView.instruments() @@ -142,6 +144,10 @@ Rectangle { onAddSelectedInstrumentsToScoreRequested: { prv.addSelectedInstrumentsToScore() + + if (!root.canSelectMultipleInstruments) { + root.submitRequested() + } } } diff --git a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/InstrumentsDialog.qml b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/InstrumentsDialog.qml index 84109c469eb8d..ab21f761257df 100644 --- a/src/instrumentsscene/qml/MuseScore/InstrumentsScene/InstrumentsDialog.qml +++ b/src/instrumentsscene/qml/MuseScore/InstrumentsScene/InstrumentsDialog.qml @@ -43,6 +43,15 @@ StyledDialogView { instrumentsPage.focusOnFirst() } + function submit() { + var result = {} + result["instruments"] = instrumentsPage.instruments() + result["scoreOrder"] = instrumentsPage.currentOrder() + + root.ret = { errcode: 0, value: result } + root.hide() + } + ColumnLayout { anchors.fill: parent spacing: 20 @@ -57,6 +66,10 @@ StyledDialogView { currentInstrumentId: root.currentInstrumentId navigationSection: root.navigationSection + + onSubmitRequested: { + root.submit() + } } RowLayout { @@ -106,12 +119,7 @@ StyledDialogView { navigation.column: 2 onClicked: { - var result = {} - result["instruments"] = instrumentsPage.instruments() - result["scoreOrder"] = instrumentsPage.currentOrder() - - root.ret = { errcode: 0, value: result } - root.hide() + root.submit() } } }