mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 22:04:56 +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>
93 lines
2.9 KiB
QML
93 lines
2.9 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import QmlComponents 1.0
|
|
|
|
Rectangle {
|
|
id: codeEditorRoot
|
|
objectName: "luaCodeEditor"
|
|
Accessible.role: Accessible.EditableText
|
|
Accessible.name: "Lua code editor"
|
|
Layout.fillWidth: true
|
|
Layout.fillHeight: true
|
|
color: "#1e1e2e"
|
|
border.color: Theme.border
|
|
border.width: 1
|
|
|
|
property alias code: codeEditor.text
|
|
property string scriptName: ""
|
|
|
|
ColumnLayout {
|
|
anchors.fill: parent
|
|
spacing: 0
|
|
|
|
// Line number gutter + code area
|
|
Rectangle {
|
|
Layout.fillWidth: true
|
|
Layout.fillHeight: true
|
|
color: "transparent"
|
|
|
|
ScrollView {
|
|
anchors.fill: parent
|
|
clip: true
|
|
|
|
TextArea {
|
|
id: codeEditor
|
|
activeFocusOnTab: true
|
|
Accessible.role: Accessible.EditableText
|
|
Accessible.name: "Lua code editor"
|
|
Accessible.multiLine: true
|
|
Accessible.description:
|
|
"Enter Lua script code here"
|
|
font.family: "Consolas, 'Courier New', monospace"
|
|
font.pixelSize: 13
|
|
color: "#cdd6f4"
|
|
selectionColor: "#45475a"
|
|
selectedTextColor: "#cdd6f4"
|
|
wrapMode: TextEdit.NoWrap
|
|
tabStopDistance: 28
|
|
padding: 16
|
|
leftPadding: 56
|
|
|
|
background: Rectangle {
|
|
color: "transparent"
|
|
|
|
// Line numbers column
|
|
Column {
|
|
x: 4
|
|
y: codeEditor.topPadding
|
|
width: 44
|
|
|
|
Repeater {
|
|
model: codeEditor.text.split("\n").length
|
|
delegate: Text {
|
|
width: 40
|
|
height: codeEditor.font.pixelSize * 1.4
|
|
horizontalAlignment: Text.AlignRight
|
|
text: (index + 1).toString()
|
|
font.family: codeEditor.font.family
|
|
font.pixelSize: codeEditor.font.pixelSize
|
|
color: "#585b70"
|
|
}
|
|
}
|
|
}
|
|
|
|
// Gutter separator
|
|
Rectangle {
|
|
x: 48
|
|
y: 0
|
|
width: 1
|
|
height: parent.height
|
|
color: "#313244"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
LuaEditorStatusBar {
|
|
lineCount: codeEditor.text.split("\n").length
|
|
}
|
|
}
|
|
}
|