From 799e00d25260cb61b0695ac173a2bf48a152ec44 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Tue, 12 Mar 2024 14:26:37 +0000 Subject: [PATCH] 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. --- app/qml/DevicePage.qml | 9 ++++++++- app/qml/Main.qml | 2 +- app/qml/PluginSettings.qml | 5 +++++ app/qml/mpris.qml | 2 ++ app/qml/runcommand.qml | 2 ++ smsapp/qml/ConversationList.qml | 2 ++ 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/qml/DevicePage.qml b/app/qml/DevicePage.qml index e33265a3e..07747592a 100644 --- a/app/qml/DevicePage.qml +++ b/app/qml/DevicePage.qml @@ -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 diff --git a/app/qml/Main.qml b/app/qml/Main.qml index 49eab9ad8..fc91a1714 100644 --- a/app/qml/Main.qml +++ b/app/qml/Main.qml @@ -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} diff --git a/app/qml/PluginSettings.qml b/app/qml/PluginSettings.qml index 137a3d57c..f515712f1 100644 --- a/app/qml/PluginSettings.qml +++ b/app/qml/PluginSettings.qml @@ -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; diff --git a/app/qml/mpris.qml b/app/qml/mpris.qml index d2aa2c4e2..ee8c8d0d0 100644 --- a/app/qml/mpris.qml +++ b/app/qml/mpris.qml @@ -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 diff --git a/app/qml/runcommand.qml b/app/qml/runcommand.qml index fe1da318d..8dcf15112 100644 --- a/app/qml/runcommand.qml +++ b/app/qml/runcommand.qml @@ -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 diff --git a/smsapp/qml/ConversationList.qml b/smsapp/qml/ConversationList.qml index 4dcfad9e4..00b912403 100644 --- a/smsapp/qml/ConversationList.qml +++ b/smsapp/qml/ConversationList.qml @@ -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