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

54 lines
1.3 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QmlComponents 1.0
// Language selector pill (e.g. "EN")
Item {
id: root
Accessible.role: Accessible.Button
Accessible.name: "Language: "
+ currentLanguage
property string currentLanguage: "EN"
property bool isDark: Theme.mode === "dark"
signal clicked()
width: langText.implicitWidth + 20
height: 28
activeFocusOnTab: true
Keys.onReturnPressed: root.clicked()
Keys.onSpacePressed: root.clicked()
// ── MD3 palette ──
readonly property color surfaceContainer: isDark
? Qt.rgba(1, 1, 1, 0.05) : Qt.rgba(0.31, 0.31, 0.44, 0.06)
readonly property color outlineVariant: isDark
? Qt.rgba(1, 1, 1, 0.06) : Qt.rgba(0, 0, 0, 0.08)
Rectangle {
anchors.fill: parent
radius: 14
color: surfaceContainer
border.color: outlineVariant
border.width: 1
CText {
id: langText
anchors.centerIn: parent
text: root.currentLanguage
font.pixelSize: 11
font.weight: Font.Bold
font.family: "monospace"
color: Theme.textSecondary
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: root.clicked()
}
}
}