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>
82 lines
2.2 KiB
QML
82 lines
2.2 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import QmlComponents 1.0
|
|
|
|
CDialog {
|
|
id: root
|
|
objectName: "dialog_delete_confirm"
|
|
Accessible.role: Accessible.Dialog
|
|
Accessible.name: title
|
|
activeFocusOnTab: true
|
|
|
|
property string itemName: ""
|
|
property string description: "This action cannot be undone."
|
|
|
|
signal confirmed()
|
|
|
|
title: "Confirm Delete"
|
|
|
|
ColumnLayout {
|
|
spacing: 16
|
|
width: 320
|
|
|
|
CAlert {
|
|
Layout.fillWidth: true
|
|
severity: "warning"
|
|
text: itemName.length > 0
|
|
? "Are you sure you want to delete \"" + itemName + "\"?"
|
|
: "No item selected."
|
|
}
|
|
|
|
CText {
|
|
variant: "body2"
|
|
text: root.description
|
|
wrapMode: Text.WordWrap
|
|
Layout.fillWidth: true
|
|
}
|
|
|
|
FlexRow {
|
|
Layout.fillWidth: true
|
|
spacing: 12
|
|
|
|
CButton {
|
|
text: "Cancel"
|
|
variant: "ghost"
|
|
activeFocusOnTab: true
|
|
Accessible.role: Accessible.Button
|
|
Accessible.name: "Cancel"
|
|
Accessible.description:
|
|
"Close without deleting"
|
|
Keys.onReturnPressed:
|
|
root.visible = false
|
|
Keys.onSpacePressed:
|
|
root.visible = false
|
|
onClicked: root.visible = false
|
|
}
|
|
Item { Layout.fillWidth: true }
|
|
CButton {
|
|
text: "Delete"
|
|
variant: "danger"
|
|
activeFocusOnTab: true
|
|
Accessible.role: Accessible.Button
|
|
Accessible.name: "Confirm delete"
|
|
Accessible.description:
|
|
"Permanently delete this item"
|
|
Keys.onReturnPressed: {
|
|
root.confirmed()
|
|
root.visible = false
|
|
}
|
|
Keys.onSpacePressed: {
|
|
root.confirmed()
|
|
root.visible = false
|
|
}
|
|
onClicked: {
|
|
root.confirmed()
|
|
root.visible = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|