Skip to content

Commit 788262d

Browse files
committed
feat: add tab focus support for CheckBox and RadioButton
1. Added focusPolicy: Qt.TabFocus to both CheckBox.qml and RadioButton.qml components 2. This change enables keyboard navigation via tab key for better accessibility 3. Previously these components couldn't receive focus through tab navigation 4. Improves user experience for keyboard-only users and accessibility compliance feat: 为复选框和单选按钮添加标签页焦点支持 1. 在 CheckBox.qml 和 RadioButton.qml 组件中添加了 focusPolicy: Qt.TabFocus 2. 此更改使得可以通过Tab键进行键盘导航,提高可访问性 3. 之前这些组件无法通过Tab导航获取焦点 4. 改善了仅使用键盘用户的体验并提高可访问性合规性 pms: BUG-317505
1 parent e9e6d71 commit 788262d

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

qt6/src/qml/CheckBox.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ T.CheckBox {
2525
opacity: D.ColorSelector.controlState === D.DTK.DisabledState ? 0.4 : 1
2626
D.DciIcon.mode: D.ColorSelector.controlState
2727
D.DciIcon.theme: D.ColorSelector.controlTheme
28+
focusPolicy: Qt.TabFocus
2829
indicator: Item {
2930
x: control.text ? (!control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2
3031
y: control.topPadding + (control.availableHeight - height) / 2

qt6/src/qml/RadioButton.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ T.RadioButton {
2020
opacity: D.ColorSelector.controlState === D.DTK.DisabledState ? 0.4 : 1
2121
D.DciIcon.mode: D.ColorSelector.controlState
2222
D.DciIcon.theme: D.ColorSelector.controlTheme
23+
focusPolicy: Qt.TabFocus
2324
icon {
2425
width: DS.Style.radioButton.iconSize
2526
height: DS.Style.radioButton.iconSize

0 commit comments

Comments
 (0)