From 5ba3d9ad73caaa996f465b651f73b39a30148ad0 Mon Sep 17 00:00:00 2001 From: Shubham Shinde Date: Thu, 8 Aug 2024 23:55:56 +0530 Subject: [PATCH] Fix Edit MIDI Mapping Dialog Accessibility --- .../Muse/Shortcuts/EditMidiMappingDialog.qml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/framework/shortcuts/qml/Muse/Shortcuts/EditMidiMappingDialog.qml b/src/framework/shortcuts/qml/Muse/Shortcuts/EditMidiMappingDialog.qml index 681910339b290..e6cdbac630d30 100644 --- a/src/framework/shortcuts/qml/Muse/Shortcuts/EditMidiMappingDialog.qml +++ b/src/framework/shortcuts/qml/Muse/Shortcuts/EditMidiMappingDialog.qml @@ -38,6 +38,13 @@ StyledDialogView { signal mapToEventRequested(var event) + property NavigationPanel navigationPanel: NavigationPanel { + name: "EditMidiMappingDialog" + section: root.navigationSection + order: 1 + direction: NavigationPanel.Horizontal + } + function startEdit(action) { model.load(action.mappedType, action.mappedValue) actionNameLabel.text = action.title @@ -46,6 +53,10 @@ StyledDialogView { open() } + onNavigationActivateRequested: { + mappingField.navigation.requestActive() + } + Rectangle { anchors.fill: parent @@ -105,6 +116,9 @@ StyledDialogView { //: The app is waiting for the user to trigger a valid MIDI remote event hint: qsTrc("shortcuts", "Waiting…") + + navigation.panel: root.navigationPanel + navigation.order: 1 } } @@ -113,6 +127,8 @@ StyledDialogView { buttons: [ ButtonBoxModel.Cancel ] + navigationPanel.section: root.navigationSection + FlatButton { text: qsTrc("global", "Add") buttonRole: ButtonBoxModel.ApplyRole @@ -132,6 +148,13 @@ StyledDialogView { } } } + + Keys.onShortcutOverride: function(event) { + if(event.key === Qt.Key_Tab) { + focus = false + } + event.accepted = event.key !== Qt.Key_Tab + } } } }