Skip to content

Commit 36c874d

Browse files
Merge pull request #30155 from cbjeukendrup/fdl_keynav
Fix keyboard navigation in Fretboard Diagram Legend properties
2 parents 851bb1c + 85ec6d4 commit 36c874d

File tree

10 files changed

+35
-28
lines changed

10 files changed

+35
-28
lines changed

src/inspector/view/qml/MuseScore/Inspector/common/ColorSection.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ InspectorPropertyView {
4242
navigation.name: root.navigationName + " ColorPicker"
4343
navigation.panel: root.navigationPanel
4444
navigation.row: root.navigationRowStart + 1
45-
navigation.accessible.name: root.titleText + " " + Utils.accessibleColorDescription(colorPicker.color)
45+
navigation.accessible.name: root.accessibleName + " " + Utils.accessibleColorDescription(colorPicker.color)
4646

4747
enabled: root.propertyItem ? root.propertyItem.isEnabled : false
4848
isIndeterminate: root.propertyItem && enabled ? root.propertyItem.isUndefined : false

src/inspector/view/qml/MuseScore/Inspector/common/DropdownPropertyView.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ InspectorPropertyView {
4747
navigation.name: root.navigationName + " Dropdown"
4848
navigation.panel: root.navigationPanel
4949
navigation.row: root.navigationRowStart + 1
50-
navigation.accessible.name: root.titleText + " " + currentText
50+
navigation.accessible.name: root.accessibleName + " " + currentText
5151

5252
currentIndex: root.propertyItem && !root.propertyItem.isUndefined
5353
? dropdownItem.indexOfValue(root.propertyItem.value)

src/inspector/view/qml/MuseScore/Inspector/common/FlatRadioButtonGroupPropertyView.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ InspectorPropertyView {
5454

5555
navigationPanel: root.navigationPanel
5656
navigationRowStart: root.navigationRowStart
57-
accessibleName: root.titleText
57+
accessibleName: root.accessibleName
5858

5959
iconFontSize: root.requestIconFontSize
6060

src/inspector/view/qml/MuseScore/Inspector/common/InspectorPropertyView.qml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ Column {
4545
property alias showTitle: titleLabelLoader.visible
4646
property alias showButton: buttonLoader.visible
4747

48+
property string accessibleName: titleText
49+
4850
readonly property bool isStyled: propertyItem ? propertyItem.isStyled : false
4951
property bool isModified: propertyItem ? propertyItem.isModified : false
5052

@@ -124,8 +126,8 @@ Column {
124126
navigation.name: root.navigationName + "Reset"
125127
navigation.panel: root.navigationPanel
126128
navigation.row: root.buttonNavigationRow
127-
navigation.accessible.name: root.titleText ? qsTrc("inspector", "Reset “%1” to default value").arg(root.titleText)
128-
: qsTrc("inspector", "Reset property to default value")
129+
navigation.accessible.name: root.accessibleName ? qsTrc("inspector", "Reset “%1” to default value").arg(root.accessibleName)
130+
: qsTrc("inspector", "Reset property to default value")
129131

130132
enabled: root.isModified
131133

@@ -145,7 +147,9 @@ Column {
145147
navigation.name: root.navigationName + " Menu Button"
146148
navigation.panel: root.navigationPanel
147149
navigation.row: root.buttonNavigationRow
148-
navigation.accessible.name: root.titleText + " " + qsTrc("inspector", "Menu")
150+
151+
//: %1 is replaced with the name of the property
152+
navigation.accessible.name: qsTrc("inspector", "Menu for “%1”").arg(root.accessibleName)
149153

150154
menuModel: {
151155
var result = []

src/inspector/view/qml/MuseScore/Inspector/common/OffsetSection.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ InspectorPropertyView {
5353
navigation.name: "HorizontalOffsetControl"
5454
navigation.panel: root.navigationPanel
5555
navigation.row: root.navigationRowStart + 1
56-
navigation.accessible.name: root.titleText + " " + qsTrc("inspector", "Horizontal") + " " + currentValue
56+
navigation.accessible.name: root.accessibleName + " " + qsTrc("inspector", "Horizontal") + " " + currentValue
5757

5858
icon: IconCode.HORIZONTAL
5959

@@ -75,7 +75,7 @@ InspectorPropertyView {
7575
navigation.name: "VerticalOffsetControl"
7676
navigation.panel: root.navigationPanel
7777
navigation.row: root.navigationRowStart + 2
78-
navigation.accessible.name: root.titleText + " " + qsTrc("inspector", "Vertical") + " " + currentValue
78+
navigation.accessible.name: root.accessibleName + " " + qsTrc("inspector", "Vertical") + " " + currentValue
7979

8080
icon: IconCode.VERTICAL
8181

src/inspector/view/qml/MuseScore/Inspector/common/SpinBoxPropertyView.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ InspectorPropertyView {
5252
navigation.name: root.navigationName + " Spinbox"
5353
navigation.panel: root.navigationPanel
5454
navigation.row: root.navigationRowStart + 1
55-
navigation.accessible.name: root.titleText
55+
navigation.accessible.name: root.accessibleName
5656

5757
isIndeterminate: root.propertyItem ? root.propertyItem.isUndefined : true
5858
currentValue: Boolean(root.propertyItem) && !Boolean(root.propertyItem.isUndefined) ? root.propertyItem.value : 0.0

src/inspector/view/qml/MuseScore/Inspector/notation/frames/internal/FretFrameChordsControlPanel.qml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ RowLayout {
5151
signal resetListRequested();
5252

5353
FlatButton {
54-
id: upBotton
54+
id: upButton
5555

5656
Layout.fillWidth: true
5757

5858
icon: IconCode.ARROW_UP
5959
enabled: root.isMovingUpAvailable
60+
toolTipTitle: qsTrc("inspector", "Move up")
6061

6162
navigation.name: "MoveUpButton"
6263
navigation.panel: root.navigationPanel
6364
navigation.row: root.navigationRowStart
64-
navigation.accessible.name: qsTrc("inspector", "Move up")
6565

6666
onClicked: {
6767
root.moveSelectionUpRequested()
@@ -75,11 +75,11 @@ RowLayout {
7575

7676
icon: IconCode.ARROW_DOWN
7777
enabled: root.isMovingDownAvailable
78+
toolTipTitle: qsTrc("inspector", "Move down")
7879

7980
navigation.name: "MoveDownButton"
8081
navigation.panel: root.navigationPanel
81-
navigation.row: upBotton.navigation.row + 1
82-
navigation.accessible.name: qsTrc("inspector", "Move down")
82+
navigation.row: upButton.navigation.row + 1
8383

8484
onClicked: {
8585
root.moveSelectionDownRequested()
@@ -89,12 +89,12 @@ RowLayout {
8989
PropertyResetButton {
9090
id: resetButton
9191

92+
enabled: root.listOrderItem.isModified || root.hasInvisibleChords
93+
toolTipTitle: qsTrc("inspector", "Reset chord list")
94+
9295
navigation.name: "ResetButton"
9396
navigation.panel: root.navigationPanel
9497
navigation.row: downButton.navigation.row + 1
95-
navigation.accessible.name: qsTrc("inspector", "Reset chord list")
96-
97-
enabled: root.listOrderItem.isModified || root.hasInvisibleChords
9898

9999
onClicked: {
100100
root.resetListRequested()

src/inspector/view/qml/MuseScore/Inspector/notation/frames/internal/FretFrameChordsView.qml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ StyledListView {
3131

3232
property NavigationPanel navigationPanel: null
3333
property int navigationRowStart: 1
34+
property int navigationRowEnd: navigationRowStart + (count * 2) - 1
3435

3536
spacing: 0
3637

@@ -72,8 +73,7 @@ StyledListView {
7273

7374
navigation.name: item.title
7475
navigation.panel: root.navigationPanel
75-
navigation.row: root.navigationRowStart + model.index
76-
navigation.column: 0
76+
navigation.row: root.navigationRowStart + (model.index * 2)
7777
navigation.accessible.name: item.title
7878
navigation.onActiveChanged: {
7979
if (navigation.active) {
@@ -94,8 +94,7 @@ StyledListView {
9494
Layout.alignment: Qt.AlignLeft
9595

9696
navigation.panel: root.navigationPanel
97-
navigation.row: itemDelegate.navigation.row
98-
navigation.column: 1
97+
navigation.row: root.navigationRowStart + (model.index * 2) + 1
9998
accessibleText: titleLabel.text
10099

101100
isVisible: itemDelegate.item.isVisible

src/inspector/view/qml/MuseScore/Inspector/notation/frames/internal/FretFrameSettingsTab.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ FocusableItem {
5151

5252
navigation.name: "Scale with staff size"
5353
navigation.panel: root.navigationPanel
54-
navigation.row: alignmentSection.navigationRowEnd + 1
54+
navigation.row: root.navigationRowStart
5555
}
5656

5757
FretFrameScalesSection {
@@ -60,7 +60,7 @@ FocusableItem {
6060
diagramScale: root.model ? root.model.diagramScale : null
6161

6262
navigationPanel: root.navigationPanel
63-
navigationRowStart: root.navigationRowStart + 1
63+
navigationRowStart: matchStaffSize.navigation.row + 1
6464
}
6565

6666
FretFrameGapsSection {
@@ -116,7 +116,7 @@ FocusableItem {
116116
notationGapBelow: root.model ? root.model.paddingToNotationBelow : null
117117

118118
navigationPanel: root.navigationPanel
119-
navigationRowStart: matchStaffSize.navigationRowEnd + 1
119+
navigationRowStart: alignmentSection.navigationRowEnd + 1
120120
}
121121

122122
SeparatorLine { anchors.margins: -12 }

src/inspector/view/qml/MuseScore/Inspector/notation/frames/internal/VerticalGapsSection.qml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Item {
3737

3838
property NavigationPanel navigationPanel: null
3939
property int navigationRowStart: 1
40-
property int navigationRowEnd: gapBelow.navigationRowEnd
40+
property int navigationRowEnd: gapNotationBelow.navigationRowEnd
4141

4242
height: childrenRect.height
4343
width: parent.width
@@ -48,7 +48,7 @@ Item {
4848

4949
StyledTextLabel {
5050
id: gapToStaff
51-
horizontalAlignment: Qt.AlignLeft
51+
horizontalAlignment: Text.AlignLeft
5252
text: qsTrc("inspector", "Gap to staff/frames")
5353
font: ui.theme.bodyBoldFont
5454
}
@@ -69,6 +69,7 @@ Item {
6969

7070
navigationPanel: root.navigationPanel
7171
navigationRowStart: root.navigationRowStart + 1
72+
accessibleName: qsTrc("inspector", "Gap to staff/frames above")
7273
}
7374

7475
SpinBoxPropertyView {
@@ -86,13 +87,14 @@ Item {
8687

8788
navigationPanel: root.navigationPanel
8889
navigationRowStart: gapAbove.navigationRowEnd + 1
90+
accessibleName: qsTrc("inspector", "Gap to staff/frames below")
8991
}
9092

9193
StyledTextLabel {
9294
id: notationPadding
9395
anchors.top: gapAbove.bottom
9496
anchors.topMargin: 12
95-
horizontalAlignment: Qt.AlignLeft
97+
horizontalAlignment: Text.AlignLeft
9698
text: qsTrc("inspector", "Clearance for notation")
9799
font: ui.theme.bodyBoldFont
98100
}
@@ -112,7 +114,8 @@ Item {
112114
measureUnitsSymbol: qsTrc("global", "sp")
113115

114116
navigationPanel: root.navigationPanel
115-
navigationRowStart: root.navigationRowStart + 1
117+
navigationRowStart: gapBelow.navigationRowEnd + 1
118+
accessibleName: qsTrc("inspector", "Clearance for notation above")
116119
}
117120

118121
SpinBoxPropertyView {
@@ -129,6 +132,7 @@ Item {
129132
measureUnitsSymbol: qsTrc("global", "sp")
130133

131134
navigationPanel: root.navigationPanel
132-
navigationRowStart: gapAbove.navigationRowEnd + 1
135+
navigationRowStart: gapNotationAbove.navigationRowEnd + 1
136+
accessibleName: qsTrc("inspector", "Clearance for notation below")
133137
}
134138
}

0 commit comments

Comments
 (0)