mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
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>
66 lines
2.1 KiB
QML
66 lines
2.1 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import QmlComponents 1.0
|
|
|
|
CCard {
|
|
id: root
|
|
objectName: "sidebar_backend_list"
|
|
Accessible.role: Accessible.List
|
|
Accessible.name: "Backend List"
|
|
Layout.preferredWidth: 300
|
|
Layout.fillHeight: true
|
|
|
|
property var backends: []
|
|
property int selectedIndex: 0
|
|
|
|
signal backendSelected(int index)
|
|
|
|
ColumnLayout {
|
|
anchors.fill: parent
|
|
anchors.margins: 16
|
|
spacing: 8
|
|
|
|
CText { variant: "subtitle1"
|
|
text: "Backends (" + backends.length + ")" }
|
|
CDivider { Layout.fillWidth: true }
|
|
|
|
ListView {
|
|
Layout.fillWidth: true
|
|
Layout.fillHeight: true
|
|
model: root.backends
|
|
spacing: 4
|
|
clip: true
|
|
|
|
delegate: CListItem {
|
|
width: parent ? parent.width : 268
|
|
title: modelData.name
|
|
subtitle: modelData.key
|
|
selected: index === root.selectedIndex
|
|
leadingIcon: modelData.status === "connected"
|
|
? "check_circle"
|
|
: (modelData.status === "error"
|
|
? "error" : "radio_button_unchecked")
|
|
activeFocusOnTab: true
|
|
Accessible.role: Accessible.ListItem
|
|
Accessible.name: modelData.name
|
|
Accessible.description:
|
|
modelData.key + " — " + modelData.status
|
|
Keys.onReturnPressed: root.backendSelected(index)
|
|
Keys.onSpacePressed: root.backendSelected(index)
|
|
onClicked: root.backendSelected(index)
|
|
|
|
CStatusBadge {
|
|
anchors.right: parent.right
|
|
anchors.rightMargin: 12
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
status: modelData.status === "connected"
|
|
? "success"
|
|
: (modelData.status === "error" ? "error" : "warning")
|
|
text: modelData.status
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|