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

58 lines
1.7 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QmlComponents 1.0
// Centered level navigation buttons for the app bar
Item {
id: root
Accessible.role: Accessible.MenuBar
Accessible.name: "Level navigation"
property string currentView: "frontpage"
property int currentLevel: 1
property var levels: [
{ label: "Home", level: 1, view: "frontpage" },
{ label: "User", level: 2, view: "dashboard" },
{ label: "Mod", level: 3, view: "moderator" },
{ label: "Admin", level: 4, view: "admin" },
{ label: "God", level: 5, view: "god-panel" },
{ label: "Super", level: 6, view: "supergod" }
]
signal navigate(string view)
implicitWidth: navRow.implicitWidth
implicitHeight: navRow.implicitHeight
RowLayout {
id: navRow
anchors.fill: parent
spacing: 6
Repeater {
model: root.levels
delegate: CButton {
activeFocusOnTab: true
Accessible.role: Accessible.Link
Accessible.name: modelData.label
Accessible.description:
"Navigate to "
+ modelData.label + " view"
visible:
modelData.level <= root.currentLevel
text: modelData.label
variant:
root.currentView === modelData.view
? "default" : "text"
size: "sm"
Keys.onReturnPressed:
root.navigate(modelData.view)
Keys.onSpacePressed:
root.navigate(modelData.view)
onClicked: root.navigate(modelData.view)
}
}
}
}