[plasma/plasma-mobile] components/mobileshell/qml/actiondrawer/private: mobileshell: Expose the quick settings tiles to accessibility
Jorijn van der Graaf <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 0a61dfbd0a2a78c880bc044cba765c4d319e54b2 by Jorijn van der Graaf.
Committed on 30/07/2026 at 18:18.
Pushed by devinlin into branch 'master'.
mobileshell: Expose the quick settings tiles to accessibility
The tiles themselves are not in the accessibility tree: only their two
MarqueeLabels are, and each reports the rect of its full unclipped string,
which is wider than the tile and moves as the marquee scrolls. Assistive
technology therefore has neither the tile's geometry, nor its state, nor a
way to activate it.
Expose the delegate as a button carrying the tile's name, its state as the
description, and a press action. The On/Off fallback moves into a shared
statusText property so the visible label and the accessible description
cannot drift apart.
M +7 -0 components/mobileshell/qml/actiondrawer/private/QuickSettingsDelegate.qml
M +1 -2 components/mobileshell/qml/actiondrawer/private/QuickSettingsFullDelegate.qml
https://invent.kde.org/plasma/plasma-mobile/-/commit/0a61dfbd0a2a78c880bc044cba765c4d319e54b2
diff --git a/components/mobileshell/qml/actiondrawer/private/QuickSettingsDelegate.qml b/components/mobileshell/qml/actiondrawer/private/QuickSettingsDelegate.qml
index a98b3a0b9..10912ef16 100644
--- a/components/mobileshell/qml/actiondrawer/private/QuickSettingsDelegate.qml
+++ b/components/mobileshell/qml/actiondrawer/private/QuickSettingsDelegate.qml
@@ -34,6 +34,13 @@ MobileShell.BaseItem {
// set by children
property var iconItem
+ readonly property string statusText: root.status ? root.status : (root.enabled ? i18nc("@info:status quick setting is on", "On") : i18nc("@info:status quick setting is off", "Off"))
+
+ Accessible.role: Accessible.Button
+ Accessible.name: root.text
+ Accessible.description: root.statusText
+ Accessible.onPressAction: root.delegateClick()
+
Kirigami.Theme.inherit: false
Kirigami.Theme.colorSet: Kirigami.Theme.Button
diff --git a/components/mobileshell/qml/actiondrawer/private/QuickSettingsFullDelegate.qml b/components/mobileshell/qml/actiondrawer/private/QuickSettingsFullDelegate.qml
index 2f5e4efec..7cd9f0423 100644
--- a/components/mobileshell/qml/actiondrawer/private/QuickSettingsFullDelegate.qml
+++ b/components/mobileshell/qml/actiondrawer/private/QuickSettingsFullDelegate.qml
@@ -94,8 +94,7 @@ QuickSettingsDelegate {
}
MobileShell.MarqueeLabel {
- // if no status is given, just use On/Off
- inputText: root.status ? root.status : (root.enabled ? i18n("On") : i18n("Off"))
+ inputText: root.statusText
opacity: 0.6
Layout.fillWidth: true