Files
metabuilder/qml/MetaBuilder/CDropdownMenuItem.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

55 lines
1.4 KiB
QML

import QtQuick
import QtQuick.Layouts
import QmlComponents 1.0
Rectangle {
id: root
objectName: "menuitem_" + action
Accessible.role: Accessible.MenuItem
Accessible.name: label
activeFocusOnTab: true
property bool isDark: Theme.mode === "dark"
property string icon: ""
property string label: ""
property color itemColor: "transparent"
property string action: ""
signal triggered(string action)
Layout.fillWidth: true
height: 36
radius: 8
color: itemMA.containsMouse
? (isDark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.04)) : "transparent"
RowLayout {
anchors.fill: parent
anchors.leftMargin: 12
spacing: 10
CText {
text: root.icon
font.pixelSize: 14
color: root.itemColor !== "transparent"
? root.itemColor : Theme.textSecondary
}
CText {
text: root.label
font.pixelSize: 13
color: root.itemColor !== "transparent"
? root.itemColor : Theme.text
}
}
Keys.onReturnPressed: root.triggered(root.action)
Keys.onSpacePressed: root.triggered(root.action)
MouseArea {
id: itemMA
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.triggered(root.action)
}
}