KeySequenceItem: be Accessible.Button, not Checkbox
KeySequenceItem is visually a button, and derives from the QtQuick.Controls type Button. It has some checkbox-like properties though, including a checked property for internal use, and QtQuick identifies it as a checkbox. This has two negative a11y consequences: first, it is confusing that something that is semantically an action (recording a keyboard shortcut sequence) is announced as a control that represents boolean state to users that can't see it. Second, the internal use of checked toggles it more than once during regular operation (to record whether recording is in progress) and so the user is exposed to multiple unnecessary announcements of "checked" "not checked".
This change explicitly sets the role Accessible.Button explicitly, solving this problem for all direct uses of KeySequenceItem.
Small test case:
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls as Controls
import org.kde.kirigami as Kirigami
import org.kde.kquickcontrols as KQuickControls
Kirigami.ApplicationWindow {
id: root
width: 400
height: 300
title: i18nc("@title:window", "KeySequenceItem Test")
pageStack.initialPage: Kirigami.Page {
Controls.Label {
anchors.centerIn: parent
KQuickControls.KeySequenceItem {
id: keySequenceItem
Accessible.name: "test"
}
}
}
}