Improve accessibility based on HAN university accessibility report

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.
This commit is contained in:
Albert Vaca Cintora 2024-03-12 14:26:37 +00:00
parent 6c777875ff
commit 799e00d252
6 changed files with 20 additions and 2 deletions

View file

@ -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
},
@ -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
@ -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

View file

@ -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}

View file

@ -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 {
@ -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;

View file

@ -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

View file

@ -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

View file

@ -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