mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 06:14:59 +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>
81 lines
2.5 KiB
QML
81 lines
2.5 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import QmlComponents 1.0
|
|
|
|
ColumnLayout {
|
|
id: root
|
|
objectName: "section_backend_connection"
|
|
Accessible.role: Accessible.Pane
|
|
Accessible.name: "Backend Connection"
|
|
Layout.fillWidth: true
|
|
spacing: 16
|
|
|
|
property string connectionString: ""
|
|
property bool isActive: false
|
|
property bool isTesting: false
|
|
property bool isConnected: false
|
|
property var testResult: undefined
|
|
|
|
signal testConnectionRequested()
|
|
signal setActiveRequested()
|
|
|
|
CText { variant: "subtitle1"; text: "Connection" }
|
|
|
|
CTextField {
|
|
label: "Connection String"
|
|
text: root.connectionString
|
|
Layout.fillWidth: true
|
|
activeFocusOnTab: true
|
|
Accessible.role: Accessible.EditableText
|
|
Accessible.name: "Connection String"
|
|
Accessible.description:
|
|
"Database connection string for this backend"
|
|
}
|
|
|
|
FlexRow {
|
|
Layout.fillWidth: true
|
|
spacing: 8
|
|
|
|
CButton {
|
|
text: root.isTesting ? "Testing..." : "Test Connection"
|
|
variant: "primary"
|
|
enabled: !root.isTesting
|
|
activeFocusOnTab: true
|
|
Accessible.role: Accessible.Button
|
|
Accessible.name: "Test Connection"
|
|
Accessible.description:
|
|
"Test the current connection string"
|
|
Keys.onReturnPressed: root.testConnectionRequested()
|
|
Keys.onSpacePressed: root.testConnectionRequested()
|
|
onClicked: root.testConnectionRequested()
|
|
}
|
|
|
|
CButton {
|
|
text: root.isActive ? "Active Backend" : "Set as Active"
|
|
variant: root.isActive ? "ghost" : "primary"
|
|
enabled: !root.isActive && root.isConnected
|
|
activeFocusOnTab: true
|
|
Accessible.role: Accessible.Button
|
|
Accessible.name: root.isActive
|
|
? "Active Backend" : "Set as Active"
|
|
Accessible.description:
|
|
"Set this backend as the active database"
|
|
Keys.onReturnPressed: root.setActiveRequested()
|
|
Keys.onSpacePressed: root.setActiveRequested()
|
|
onClicked: root.setActiveRequested()
|
|
}
|
|
|
|
Item { Layout.fillWidth: true }
|
|
|
|
Loader {
|
|
active: root.testResult !== undefined
|
|
sourceComponent: CStatusBadge {
|
|
status: root.testResult === "success" ? "success" : "error"
|
|
text: root.testResult === "success"
|
|
? "Connection OK" : "Connection Failed"
|
|
}
|
|
}
|
|
}
|
|
}
|