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>
139 lines
4.2 KiB
QML
139 lines
4.2 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import QmlComponents 1.0
|
|
import "qmllib/MetaBuilder" as Meta
|
|
import "ModeratorData.js" as Data
|
|
|
|
Rectangle {
|
|
id: modView
|
|
color: Theme.background
|
|
objectName: "view_moderator"
|
|
Accessible.role: Accessible.Pane
|
|
Accessible.name: "Moderator View"
|
|
|
|
readonly property bool isDark:
|
|
Theme.mode === "dark"
|
|
readonly property color accentCyan: "#06B6D4"
|
|
readonly property color onSurface: Theme.text
|
|
readonly property color onSurfaceVariant:
|
|
Theme.textSecondary
|
|
property int currentTab: 0
|
|
property var reportQueue:
|
|
Data.defaultReportQueue()
|
|
property var recentActions:
|
|
Data.defaultRecentActions()
|
|
property var modStats: Data.buildStats(
|
|
reportQueue, recentActions, accentCyan)
|
|
|
|
ScrollView {
|
|
anchors.fill: parent; clip: true
|
|
contentWidth: availableWidth
|
|
|
|
ColumnLayout {
|
|
width: parent.width; spacing: 0
|
|
|
|
Item { Layout.preferredHeight: 24 }
|
|
|
|
Meta.CModeratorHeader {
|
|
accentCyan: modView.accentCyan
|
|
onSurface: modView.onSurface
|
|
onSurfaceVariant:
|
|
modView.onSurfaceVariant
|
|
}
|
|
|
|
Item { Layout.preferredHeight: 24 }
|
|
|
|
Meta.CModStatsRow {
|
|
Layout.leftMargin: 24
|
|
Layout.rightMargin: 24
|
|
stats: modView.modStats
|
|
isDark: modView.isDark
|
|
}
|
|
|
|
Item { Layout.preferredHeight: 24 }
|
|
|
|
CTabBar {
|
|
Layout.fillWidth: true
|
|
Layout.leftMargin: 24
|
|
Layout.rightMargin: 24
|
|
currentIndex: currentTab
|
|
activeFocusOnTab: true
|
|
Accessible.role: Accessible.TabBar
|
|
Accessible.name: "Moderator tabs"
|
|
Keys.onLeftPressed:
|
|
currentTab = Math.max(
|
|
0, currentTab - 1)
|
|
Keys.onRightPressed:
|
|
currentTab = Math.min(
|
|
2, currentTab + 1)
|
|
onCurrentIndexChanged:
|
|
currentTab = currentIndex
|
|
tabs: [
|
|
{ label: "Report Queue" },
|
|
{ label: "Recent Actions" },
|
|
{ label: "Settings" }
|
|
]
|
|
}
|
|
|
|
Item { Layout.preferredHeight: 16 }
|
|
|
|
StackLayout {
|
|
Layout.fillWidth: true
|
|
Layout.fillHeight: true
|
|
Layout.leftMargin: 24
|
|
Layout.rightMargin: 24
|
|
currentIndex: currentTab
|
|
|
|
ColumnLayout {
|
|
spacing: 8
|
|
Repeater {
|
|
model: reportQueue
|
|
delegate: Meta.CReportCard {
|
|
report: modelData
|
|
isDark: modView.isDark
|
|
}
|
|
}
|
|
Item {
|
|
Layout.fillHeight: true
|
|
}
|
|
}
|
|
|
|
ColumnLayout {
|
|
spacing: 8
|
|
Repeater {
|
|
model: recentActions
|
|
delegate:
|
|
Meta.CModActionCard {
|
|
action: modelData
|
|
isDark: modView.isDark
|
|
}
|
|
}
|
|
Item {
|
|
Layout.fillHeight: true
|
|
}
|
|
}
|
|
|
|
ColumnLayout {
|
|
spacing: 16
|
|
CText {
|
|
text: "Moderation Settings"
|
|
font.pixelSize: 18
|
|
font.weight: Font.Bold
|
|
}
|
|
CText {
|
|
text: "Auto-flag threshold,"
|
|
+ " word filters, and"
|
|
+ " notification"
|
|
+ " preferences."
|
|
color: onSurfaceVariant
|
|
}
|
|
Item {
|
|
Layout.fillHeight: true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|