Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ui/rp_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,12 @@ void RpWidget::accessibilityChildStateChanged(
QAccessible::updateAccessibility(&event);
}

void RpWidget::accessibilityChildSelectionChanged(int index) {
auto event = QAccessibleEvent(this, QAccessible::SelectionAdd);
event.setChild(index);
QAccessible::updateAccessibility(&event);
}

void RpWidget::accessibilityChildFocused(int index) {
QAccessibleEvent event(this, QAccessible::Focus);
event.setChild(index);
Expand Down
10 changes: 10 additions & 0 deletions ui/rp_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,16 @@ class RpWidget : public RpWidgetBase<QWidget> {
void accessibilityChildValueChanged(int index);
[[nodiscard]] virtual QAccessible::State accessibilityChildState(int index) const;
void accessibilityChildStateChanged(int index, AccessibilityState changes);

// Announces that a child was selected or deselected. A state change does
// not cover it: the Windows bridge looks at the checked flag there and
// ignores the selected one. Both directions raise the same event, the one
// that bridge forwards (SelectionRemove reaches no one) - a screen reader
// reads the new value off the child and announces the difference, so it
// only needs telling that the selection changed. SideBarButton does the
// same for the folders that are real widgets.
void accessibilityChildSelectionChanged(int index);

[[nodiscard]] virtual QAccessible::Role accessibilityChildRole() const;
[[nodiscard]] virtual QRect accessibilityChildRect(int index) const;
[[nodiscard]] virtual int accessibilityChildColumnCount(int row) const;
Expand Down