Make every settings row reachable, and every accessibility switch honest
Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -24,10 +24,43 @@ SettingRow {
|
||||
detail: root.spec ? root.spec.detail : ""
|
||||
controlWidth: 48
|
||||
|
||||
// Space and Enter write the same value the pointer would, through the same
|
||||
// verified path -- there is no second way to flip a preference here.
|
||||
function flip(): void {
|
||||
SystemSettings.commitPreference(root.setting, !root.checked);
|
||||
}
|
||||
|
||||
SettingsToggle {
|
||||
id: toggle
|
||||
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: root.checked
|
||||
onToggled: value => SystemSettings.commitPreference(root.setting, value)
|
||||
|
||||
activeFocusOnTab: true
|
||||
|
||||
Accessible.role: Accessible.CheckBox
|
||||
Accessible.name: root.label
|
||||
Accessible.description: root.detail
|
||||
Accessible.checked: root.checked
|
||||
Accessible.focusable: true
|
||||
Accessible.focused: toggle.activeFocus
|
||||
Accessible.onPressAction: root.flip()
|
||||
|
||||
Keys.onReturnPressed: root.flip()
|
||||
Keys.onEnterPressed: root.flip()
|
||||
Keys.onSpacePressed: root.flip()
|
||||
|
||||
// Focus ring only -- the switch keeps its own border at rest.
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: -3
|
||||
radius: height / 2
|
||||
color: "transparent"
|
||||
visible: toggle.activeFocus
|
||||
border.width: 2
|
||||
border.color: Theme.accentSecondary
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user