Skip to content

Commit

Permalink
Improve accessibility based on HAN university accessibility report
Browse files Browse the repository at this point in the history
Unfortunately, most issues are in Kirigami and we can't fix them from our side. Namely, these things remain unfixed: 
- `Kirigami.PlaceholderMessage` are not read by screen readers
- When navigating with the keyboard, pressing tab selects elements from right to left, which is weird
- When navigating with the keyboard, the selected element is not highlighted
- `Kirigami.Action` that don't have a `text` property don't use the `Accessible.name` property when using a screen reader.
  • Loading branch information
albertvaka committed Mar 12, 2024
1 parent 6c77787 commit 799e00d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 2 deletions.
9 changes: 8 additions & 1 deletion app/qml/DevicePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ Kirigami.ScrollablePage {
actions: [
Kirigami.Action {
icon.name: "network-disconnect"
onTriggered: root.currentDevice.unpair()
onTriggered: {
root.currentDevice.unpair()
pageStack.pop(0)
}
text: i18nd("kdeconnect-app", "Unpair")
visible: root.currentDevice && root.currentDevice.isPaired
},
Expand Down Expand Up @@ -122,6 +125,8 @@ Kirigami.ScrollablePage {
]

Kirigami.PlaceholderMessage {
// FIXME: not accessible. screen readers won't read this. Idem for the other PlaceholderMessages
// https://invent.kde.org/frameworks/kirigami/-/merge_requests/1482
text: i18nd("kdeconnect-app", "This device is not paired")
anchors.centerIn: parent
visible: root.currentDevice && root.currentDevice.isReachable && !root.currentDevice.isPaired && !root.currentDevice.isPairRequestedByPeer && !root.currentDevice.isPairRequested
Expand Down Expand Up @@ -162,6 +167,8 @@ Kirigami.ScrollablePage {
}

Kirigami.PlaceholderMessage {
// FIXME: not accessible. screen readers won't read this.
// https://invent.kde.org/frameworks/kirigami/-/merge_requests/1482
visible: root.currentDevice && !root.currentDevice.isReachable
text: i18nd("kdeconnect-app", "This device is not reachable")
anchors.centerIn: parent
Expand Down
2 changes: 1 addition & 1 deletion app/qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Kirigami.ApplicationWindow {
enabled: status & DevicesModel.Reachable
checked: pageStack.currentItem && pageStack.currentItem.currentDevice == device
onClicked: {
root.pageStack.clear()
root.pageStack.pop(0)
root.pageStack.push(
Qt.resolvedUrl("DevicePage.qml"),
{currentDevice: device}
Expand Down
5 changes: 5 additions & 0 deletions app/qml/PluginSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Kirigami.ScrollablePage {
Layout.alignment: Qt.AlignVCenter
checked: model.isChecked
onToggled: model.isChecked = checked
Accessible.name: model.name
Accessible.description: model.description
}

ColumnLayout {
Expand Down Expand Up @@ -57,6 +59,9 @@ Kirigami.ScrollablePage {
Kirigami.Action {
icon.name: "settings-configure"
visible: configSource != ""
// FIXME: not accessible. screen readers won't read this and just say "push button".
// https://bugreports.qt.io/browse/QTBUG-123123
Accessible.name: i18nd("kdeconnect-app", "Configure plugin")
onTriggered: {
if (pageStack.lastItem.toString().startsWith("PluginInfoPage")) {
pageStack.lastItem.configFile = configSource;
Expand Down
2 changes: 2 additions & 0 deletions app/qml/mpris.qml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Kirigami.Page

Kirigami.PlaceholderMessage {
id: noPlayersText
// FIXME: not accessible. screen readers won't read this.
// https://invent.kde.org/frameworks/kirigami/-/merge_requests/1482
text: i18nd("kdeconnect-app", "No players available")
anchors.centerIn: parent
visible: pluginInterface.playerList.length == 0
Expand Down
2 changes: 2 additions & 0 deletions app/qml/runcommand.qml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Kirigami.ScrollablePage
}

Kirigami.PlaceholderMessage {
// FIXME: not accessible. screen readers won't read this.
// https://invent.kde.org/frameworks/kirigami/-/merge_requests/1482
visible: commandsList.count === 0
text: i18nd("kdeconnect-app", "No commands defined")
anchors.centerIn: parent
Expand Down
2 changes: 2 additions & 0 deletions smsapp/qml/ConversationList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ Kirigami.ScrollablePage
}

Kirigami.PlaceholderMessage {
// FIXME: not accessible. screen readers won't read this.
// https://invent.kde.org/frameworks/kirigami/-/merge_requests/1482
anchors.centerIn: parent
width: parent.width - (Kirigami.Units.largeSpacing * 4)
visible: deviceConnected && view.count == 0 && currentSearchText.length != 0
Expand Down

0 comments on commit 799e00d

Please sign in to comment.