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>
75 lines
2.2 KiB
QML
75 lines
2.2 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import QmlComponents 1.0
|
|
|
|
CCard {
|
|
id: root
|
|
objectName: "dropdownSidebar"
|
|
Accessible.role: Accessible.Pane
|
|
Accessible.name: "Dropdown sidebar"
|
|
|
|
property var dropdowns: []
|
|
property int selectedIndex: -1
|
|
signal itemClicked(int index)
|
|
signal addClicked()
|
|
|
|
ColumnLayout {
|
|
anchors.fill: parent
|
|
anchors.margins: 16
|
|
spacing: 12
|
|
|
|
FlexRow {
|
|
Layout.fillWidth: true
|
|
spacing: 8
|
|
CText { variant: "h4"; text: "Dropdowns" }
|
|
Item { Layout.fillWidth: true }
|
|
CButton {
|
|
text: "+ Add"
|
|
variant: "primary"
|
|
size: "sm"
|
|
activeFocusOnTab: true
|
|
Accessible.role: Accessible.Button
|
|
Accessible.name: "Add dropdown"
|
|
Keys.onReturnPressed: root.addClicked()
|
|
Keys.onSpacePressed: root.addClicked()
|
|
onClicked: root.addClicked()
|
|
}
|
|
}
|
|
|
|
CDivider { Layout.fillWidth: true }
|
|
|
|
ListView {
|
|
id: dropdownList
|
|
Layout.fillWidth: true
|
|
Layout.fillHeight: true
|
|
model: root.dropdowns
|
|
spacing: 4
|
|
clip: true
|
|
|
|
delegate: CListItem {
|
|
width: dropdownList.width
|
|
title: modelData.name
|
|
subtitle: modelData.description
|
|
selected: index === root.selectedIndex
|
|
activeFocusOnTab: true
|
|
Accessible.role: Accessible.ListItem
|
|
Accessible.name: modelData.name
|
|
Accessible.description: modelData.description
|
|
+ ", " + modelData.options.length
|
|
+ " options"
|
|
Keys.onReturnPressed: root.itemClicked(index)
|
|
Keys.onSpacePressed: root.itemClicked(index)
|
|
onClicked: root.itemClicked(index)
|
|
|
|
CBadge {
|
|
anchors.right: parent.right
|
|
anchors.rightMargin: 12
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
text: modelData.options.length + ""
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|