Skip to content

Commit

Permalink
Merge pull request musescore#11630 from VanSHOE/task11455
Browse files Browse the repository at this point in the history
fix:musescore#11455: Double clicking instrument automatically submits
  • Loading branch information
cbjeukendrup authored May 14, 2022
2 parents 0dd1451 + 7fac624 commit 751c086
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Rectangle {

property NavigationSection navigationSection: null

signal submitRequested()

function instruments() {
if (root.canSelectMultipleInstruments) {
return instrumentsOnScoreView.instruments()
Expand Down Expand Up @@ -142,6 +144,10 @@ Rectangle {

onAddSelectedInstrumentsToScoreRequested: {
prv.addSelectedInstrumentsToScore()

if (!root.canSelectMultipleInstruments) {
root.submitRequested()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -57,6 +66,10 @@ StyledDialogView {
currentInstrumentId: root.currentInstrumentId

navigationSection: root.navigationSection

onSubmitRequested: {
root.submit()
}
}

RowLayout {
Expand Down Expand Up @@ -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()
}
}
}
Expand Down

0 comments on commit 751c086

Please sign in to comment.