[plasma/plasma-mobile] shell/contents/lockscreen: lockscreen: Give the icon-only controls accessible names
Jorijn van der Graaf <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 42aaa91a2657f1a8fe908164f7edb0239e7faedc by Jorijn van der Graaf.
Committed on 30/07/2026 at 18:18.
Pushed by devinlin into branch 'master'.
lockscreen: Give the icon-only controls accessible names
The keypad keys draw their digit in a Label inside contentItem, and the
backspace and enter keys draw an icon instead, so all twelve report an
empty accessible name and a screen reader can only say "button". The
keyboard toggle and the flashlight and camera buttons are icon-only for
the same reason.
Name them, so the keypad can be used without sight. The keys are
AbstractButtons, which already report role button and already expose a
working press action, so a name is all that is missing.
M +8 -0 shell/contents/lockscreen/Keypad.qml
M +7 -0 shell/contents/lockscreen/LockScreenContent.qml
M +1 -0 shell/contents/lockscreen/PasswordBar.qml
M +4 -0 shell/contents/lockscreen/QuickActionButton.qml
https://invent.kde.org/plasma/plasma-mobile/-/commit/42aaa91a2657f1a8fe908164f7edb0239e7faedc
diff --git a/shell/contents/lockscreen/Keypad.qml b/shell/contents/lockscreen/Keypad.qml
index 7a435e050..e1cd52e5f 100644
--- a/shell/contents/lockscreen/Keypad.qml
+++ b/shell/contents/lockscreen/Keypad.qml
@@ -169,6 +169,14 @@ Item {
visible: modelData.length > 0
enabled: root.openProgress >= 0.8 && !lockScreenState.isKeyboardMode // Only enable after a certain point in animation
+ Accessible.name: {
+ switch (modelData) {
+ case "R": return i18n("Backspace");
+ case "E": return i18n("Enter");
+ default: return modelData;
+ }
+ }
+
opacity: enabled
Behavior on opacity {
SequentialAnimation {
diff --git a/shell/contents/lockscreen/LockScreenContent.qml b/shell/contents/lockscreen/LockScreenContent.qml
index 434e7edcb..2ada60144 100644
--- a/shell/contents/lockscreen/LockScreenContent.qml
+++ b/shell/contents/lockscreen/LockScreenContent.qml
@@ -24,6 +24,9 @@ Item {
property bool scrollLock: false
+ readonly property string flashlightText: i18n("Flashlight")
+ readonly property string cameraText: i18n("Camera")
+
signal passwordRequested()
// Vertical layout
@@ -146,6 +149,8 @@ Item {
QuickActionButton {
id: leftButton
buttonAction: ShellSettings.Settings.lockscreenLeftButtonAction
+ accessibleName: buttonAction === ShellSettings.Settings.Flashlight ? root.flashlightText
+ : buttonAction === ShellSettings.Settings.Camera ? root.cameraText : ""
opacity: Math.max(0, 1 - flickable.openFactor * 2)
Layout.alignment: Qt.AlignVCenter
@@ -158,6 +163,8 @@ Item {
QuickActionButton {
id: rightButton
buttonAction: ShellSettings.Settings.lockscreenRightButtonAction
+ accessibleName: buttonAction === ShellSettings.Settings.Flashlight ? root.flashlightText
+ : buttonAction === ShellSettings.Settings.Camera ? root.cameraText : ""
opacity: Math.max(0, 1 - flickable.openFactor * 2)
Layout.alignment: Qt.AlignVCenter
diff --git a/shell/contents/lockscreen/PasswordBar.qml b/shell/contents/lockscreen/PasswordBar.qml
index 0c3b9684a..e7a96091c 100644
--- a/shell/contents/lockscreen/PasswordBar.qml
+++ b/shell/contents/lockscreen/PasswordBar.qml
@@ -184,6 +184,7 @@ Rectangle {
implicitWidth: height
icon.name: root.lockScreenState.isKeyboardMode ? "input-dialpad-symbolic" : "input-keyboard-virtual-symbolic"
icon.color: 'white'
+ Accessible.name: root.lockScreenState.isKeyboardMode ? i18n("Show keypad") : i18n("Show keyboard")
onClicked: {
root.lockScreenState.isKeyboardMode = !root.lockScreenState.isKeyboardMode;
if (root.lockScreenState.isKeyboardMode) {
diff --git a/shell/contents/lockscreen/QuickActionButton.qml b/shell/contents/lockscreen/QuickActionButton.qml
index f951ff2a9..89e1a8edb 100644
--- a/shell/contents/lockscreen/QuickActionButton.qml
+++ b/shell/contents/lockscreen/QuickActionButton.qml
@@ -15,6 +15,8 @@ AbstractButton {
property int buttonAction
+ required property string accessibleName
+
property bool buttonHeld: false
property double scale: pressed ? (buttonHeld ? 1.7 : 1.5) : 1
property real fillAmount: 0.0
@@ -33,6 +35,8 @@ AbstractButton {
visible: buttonAction !== ShellSettings.Settings.None
padding: Math.round(Kirigami.Units.gridUnit * 1.25)
+ Accessible.name: root.accessibleName
+
transform: Scale {
origin.x: width / 2
origin.y: height / 2