Skip to content

Commit 0f5bebc

Browse files
committed
feat(dock): add accessibility annotations to dock QML
Expose the taskbar to screen readers (e.g. Orca over AT-SPI) via Qt Quick Accessible attached properties: - app items: button role, app name, active/attention description - task manager and dock left/center/right areas: grouping role + name - container list views: list role - show desktop / multitask view / tray action buttons: role + name - embedded tray surfaces: plugin display name when available
1 parent cf50ec5 commit 0f5bebc

10 files changed

Lines changed: 31 additions & 0 deletions

File tree

panels/dock/OverflowContainer.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Item {
2626
layoutDirection: Qt.LeftToRight
2727
verticalLayoutDirection: ListView.TopToBottom
2828
interactive: false
29+
Accessible.role: Accessible.List
2930
}
3031

3132
function calculateImplicitWidth(prev, current) {

panels/dock/multitaskview/package/multitaskview.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ AppletDockItem {
1313
id: toggleworkspace
1414
dockOrder: 15
1515

16+
Accessible.role: Accessible.Button
17+
Accessible.name: toolTip.text
18+
1619
PanelToolTip {
1720
id: toolTip
1821
text: qsTr("Multitasking View")

panels/dock/package/main.qml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,8 @@ Window {
520520
visible: dockLeftPartModel.count > 0
521521
implicitWidth: leftLoader.implicitWidth
522522
implicitHeight: leftLoader.implicitHeight
523+
Accessible.role: Accessible.Grouping
524+
Accessible.name: qsTr("Dock Left Area")
523525
OverflowContainer {
524526
id: leftLoader
525527
anchors.fill: parent
@@ -536,6 +538,8 @@ Window {
536538
id: dockCenterPart
537539
implicitWidth: centerLoader.implicitWidth
538540
implicitHeight: centerLoader.implicitHeight
541+
Accessible.role: Accessible.Grouping
542+
Accessible.name: qsTr("Dock Center Area")
539543
Layout.maximumWidth: useColumnLayout ? -1 : dockRawCenterSpace
540544
Layout.maximumHeight: useColumnLayout ? dockRawCenterSpace : -1
541545
onXChanged: dockCenterPartPosChanged()
@@ -584,6 +588,8 @@ Window {
584588
id: dockRightPart
585589
implicitWidth: rightLoader.implicitWidth
586590
implicitHeight: rightLoader.implicitHeight
591+
Accessible.role: Accessible.Grouping
592+
Accessible.name: qsTr("Dock Right Area")
587593
anchors.right: parent.right
588594
anchors.bottom: parent.bottom
589595
OverflowContainer {

panels/dock/showdesktop/package/showdesktop.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ AppletItem {
3030
anchors.fill: parent
3131
radius: 0
3232

33+
Accessible.role: Accessible.Button
34+
Accessible.name: toolTip.text
35+
3336
Rectangle {
3437
property D.Palette lineColor: DockPalette.showDesktopLineColor
3538
// Use device pixel ratio to ensure the line is always 1 physical pixel regardless of system scaling

panels/dock/taskmanager/package/AppItem.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ Item {
3636
Drag.hotSpot.y: icon.height / 2
3737
Drag.dragType: Drag.Automatic
3838
Drag.mimeData: { "text/x-dde-dock-dnd-appid": itemId, "text/x-dde-dock-dnd-source": "taskbar", "text/x-dde-dock-dnd-winid": windows.length > 0 ? windows[0] : ""}
39+
40+
Accessible.role: Accessible.Button
41+
Accessible.name: root.name
42+
Accessible.description: root.attention ? qsTr("Demands attention") : (root.active ? qsTr("Active") : "")
3943

4044
property bool useColumnLayout: Panel.rootObject.useColumnLayout
4145
property real iconSize: Panel.rootObject.dockItemMaxSize * 9 / 14

panels/dock/taskmanager/package/TaskManager.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ ContainmentItem {
1515
property bool useColumnLayout: Panel.rootObject.useColumnLayout
1616
property int dockOrder: 16
1717

18+
Accessible.role: Accessible.Grouping
19+
Accessible.name: qsTr("Task Manager")
20+
1821
function calcRemainingSpace(baseSize) {
1922
const otherCount = Panel.rootObject.dockCenterPartCount - 1;
2023
const otherOccupied = otherCount > 0 ? otherCount * baseSize * multitaskViewIconRatio : 0;

panels/dock/tray/ShellSurfaceItemProxy.qml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Item {
2222
implicitWidth: shellSurface ? shellSurface.width : 16
2323
implicitHeight: shellSurface ? shellSurface.height : 16
2424

25+
Accessible.name: shellSurface ? (shellSurface.displayName || "") : ""
26+
2527
function takeFocus() {
2628
impl.takeFocus()
2729
}

panels/dock/tray/package/ActionShowStashDelegate.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ AppletItemButton {
2525

2626
padding: itemPadding
2727

28+
Accessible.role: Accessible.Button
29+
Accessible.name: toolTip.text
30+
2831
D.ColorSelector.hovered: (isDropHover && DDT.TraySortOrderModel.actionsAlwaysVisible) || hovered || stashedPopup.popupVisible
2932

3033
property var itemGlobalPoint: {

panels/dock/tray/package/ActionToggleCollapseDelegate.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ AppletItemButton {
1717
hoverEnabled: inputEventsEnabled
1818
autoClosePopup: true
1919

20+
Accessible.role: Accessible.Button
21+
Accessible.name: toolTip.text
22+
2023
z: 5
2124

2225
icon.name: isHorizontal ? "expand-left" : "expand-up"

panels/dock/tray/package/ActionToggleQuickSettingsDelegate.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ QuickPanel {
1313
useColumnLayout: !isHorizontal
1414
trayItemPluginId: Applet.rootObject.quickpanelTrayItemPluginId
1515
trayItemMargins: itemPadding
16+
17+
Accessible.role: Accessible.Button
18+
Accessible.name: qsTr("Quick actions")
1619
}

0 commit comments

Comments
 (0)