[plasma/plasma-mobile] /: navigationpanel: Name the navigation buttons

Jorijn van der Graaf <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit ec01d6f1e5fc7611e1682929f2a6e39516be13f3 by Jorijn van der Graaf.
Committed on 30/07/2026 at 18:18.
Pushed by devinlin into branch 'master'.

navigationpanel: Name the navigation buttons

The navigation buttons are icon-only and carry no text, so a screen reader
announces all of them as "push button": they have no name, no description
and no attributes.

Give NavigationPanelAction an accessibleText property, announce it from
each button, and supply the names in the taskpanel containment, following
the icons' own logic where an action is dual-purpose.

M  +5    -0    components/mobileshell/qml/navigationpanel/NavigationPanel.qml
M  +3    -0    components/mobileshell/qml/navigationpanel/NavigationPanelAction.qml
M  +7    -0    containments/taskpanel/qml/NavigationPanelComponent.qml

https://invent.kde.org/plasma/plasma-mobile/-/commit/ec01d6f1e5fc7611e1682929f2a6e39516be13f3

diff --git a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml
index fcac9bbeb..d0828a7cf 100644
--- a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml
+++ b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml
@@ -65,6 +65,7 @@ Item {
             enabled: root.leftCornerAction.enabled
             shrinkSize: root.leftCornerAction.shrinkSize
             iconSource: root.leftCornerAction.iconSource
+            Accessible.name: root.leftCornerAction.accessibleText
             onClicked: {
                 if (enabled) {
                     root.leftCornerAction.triggered();
@@ -81,6 +82,7 @@ Item {
             enabled: root.leftAction.enabled
             shrinkSize: root.leftAction.shrinkSize
             iconSource: root.leftAction.iconSource
+            Accessible.name: root.leftAction.accessibleText
             onClicked: {
                 if (enabled) {
                     root.leftAction.triggered();
@@ -97,6 +99,7 @@ Item {
             enabled: root.middleAction.enabled
             shrinkSize: root.middleAction.shrinkSize
             iconSource: root.middleAction.iconSource
+            Accessible.name: root.middleAction.accessibleText
             onClicked: {
                 if (enabled) {
                     root.middleAction.triggered();
@@ -112,6 +115,7 @@ Item {
             enabled: root.rightAction.enabled
             shrinkSize: root.rightAction.shrinkSize
             iconSource: root.rightAction.iconSource
+            Accessible.name: root.rightAction.accessibleText
             onClicked: {
                 if (enabled) {
                     root.rightAction.triggered();
@@ -127,6 +131,7 @@ Item {
             enabled: root.rightCornerAction.enabled
             shrinkSize: root.rightCornerAction.shrinkSize
             iconSource: root.rightCornerAction.iconSource
+            Accessible.name: root.rightCornerAction.accessibleText
             onClicked: {
                 if (enabled) {
                     root.rightCornerAction.triggered();
diff --git a/components/mobileshell/qml/navigationpanel/NavigationPanelAction.qml b/components/mobileshell/qml/navigationpanel/NavigationPanelAction.qml
index 1fa3a96df..2246e699e 100644
--- a/components/mobileshell/qml/navigationpanel/NavigationPanelAction.qml
+++ b/components/mobileshell/qml/navigationpanel/NavigationPanelAction.qml
@@ -12,5 +12,8 @@ QtObject {
     property string iconSource
     property real shrinkSize
 
+    // Description of the action for assistive technology
+    property string accessibleText
+
     signal triggered()
 }
diff --git a/containments/taskpanel/qml/NavigationPanelComponent.qml b/containments/taskpanel/qml/NavigationPanelComponent.qml
index 763460455..216ce2a49 100644
--- a/containments/taskpanel/qml/NavigationPanelComponent.qml
+++ b/containments/taskpanel/qml/NavigationPanelComponent.qml
@@ -74,6 +74,7 @@ MobileShell.NavigationPanel {
 
         enabled: true
         iconSource: "mobile-task-switcher"
+        accessibleText: i18nc("@action:button", "Task switcher")
         shrinkSize: 4
 
         onTriggered: {
@@ -87,6 +88,7 @@ MobileShell.NavigationPanel {
 
         enabled: true
         iconSource: "start-here-kde"
+        accessibleText: i18nc("@action:button", "Home")
 
         onTriggered: {
             MobileShellState.ShellDBusClient.openHomeScreen();
@@ -99,6 +101,8 @@ MobileShell.NavigationPanel {
 
         enabled: Keyboards.KWinVirtualKeyboard.visible || WindowPlugin.WindowUtil.hasCloseableActiveWindow
         iconSource: Keyboards.KWinVirtualKeyboard.visible ? "go-down-symbolic" : "mobile-close-app"
+        accessibleText: Keyboards.KWinVirtualKeyboard.visible ? i18nc("@action:button", "Hide keyboard")
+                                                              : i18nc("@action:button", "Close app")
         // mobile-close-app (from plasma-frameworks) seems to have fewer margins than icons from breeze-icons
         shrinkSize: Keyboards.KWinVirtualKeyboard.visible ? 0 : 4
 
@@ -120,6 +124,7 @@ MobileShell.NavigationPanel {
         visible: RotationPlugin.RotationUtil.showRotationButton
         enabled: true
         iconSource: "rotation-allowed-symbolic"
+        accessibleText: i18nc("@action:button", "Rotate screen")
         shrinkSize: 4
 
         onTriggered: {
@@ -133,6 +138,8 @@ MobileShell.NavigationPanel {
                  (Keyboards.KWinVirtualKeyboard.available && !Keyboards.KWinVirtualKeyboard.activeClientSupportsTextInput)
         enabled: true
         iconSource: "input-keyboard-virtual-symbolic"
+        accessibleText: Keyboards.KWinVirtualKeyboard.active ? i18nc("@action:button", "Hide keyboard")
+                                                             : i18nc("@action:button", "Show keyboard")
         shrinkSize: 4
 
         onTriggered: {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.