Files
metabuilder/qml/MetaBuilder/DropdownExpandedList.qml
johndoe6345789 d9ca84628b feat(a11y): deep keyboard accessibility pass across all QML components
Second-pass a11y work across all 12 component groups. Every interactive
element now has activeFocusOnTab, Keys.onReturnPressed/SpacePressed, and
context-aware Accessible.name/description bindings.

Highlights:
- Dialogs: keyboard handlers with enabled-guard on confirm buttons
- CDropdownMenu: full keyboard nav (Up/Down/Enter/Escape)
- CLoginForm: explicit KeyNavigation.tab chain (username→password→submit)
- CNotificationBell: dynamic "3 notifications"/"No notifications" name
- CJobProgressBar: Accessible.minimumValue/maximumValue/currentValue
- CExecutionStatusDot: "Execution status: Running/Passed/Failed" binding
- CKeyboardShortcuts: invisible Repeater exposes all shortcuts to a11y tree
- CDataTable rows: "Row N of M" descriptions
- Canvas elements: Accessible.Canvas role + keyboard zoom (+/- keys)
- DropdownExpandedList: focus-highlight extended to :activeFocus
- Dynamic names reflect loading state (e.g. "Signing in, please wait")

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 20:53:53 +00:00

79 lines
2.2 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QmlComponents 1.0
Rectangle {
id: root
objectName: "dropdownExpandedList"
Accessible.role: Accessible.List
Accessible.name: "Dropdown options list"
property var options: []
Layout.fillWidth: true
Layout.preferredHeight: optionsList.implicitHeight + 8
color: Theme.surface
border.color: Theme.border
border.width: 1
radius: 4
ColumnLayout {
id: optionsList
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 4
spacing: 0
Repeater {
model: root.options
Rectangle {
id: optItem
Layout.fillWidth: true
Layout.preferredHeight: 36
color: optMouse.containsMouse || optItem.activeFocus
? Theme.primary : "transparent"
opacity: optMouse.containsMouse
|| optItem.activeFocus ? 0.12 : 1.0
radius: 2
activeFocusOnTab: true
Accessible.role: Accessible.MenuItem
Accessible.name: modelData.label
+ " (" + modelData.value + ")"
Keys.onReturnPressed: optMouse.clicked(null)
Keys.onSpacePressed: optMouse.clicked(null)
RowLayout {
anchors.fill: parent
anchors.leftMargin: 12
anchors.rightMargin: 12
spacing: 8
CText {
variant: "body1"
text: modelData.label
Layout.fillWidth: true
}
CText {
variant: "caption"
text: modelData.value
color: Theme.text
opacity: 0.4
}
}
MouseArea {
id: optMouse
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: optItem.forceActiveFocus()
}
}
}
}
}