diff --git a/ui/rp_widget.cpp b/ui/rp_widget.cpp index 8d05fbabb..501b77d76 100644 --- a/ui/rp_widget.cpp +++ b/ui/rp_widget.cpp @@ -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); diff --git a/ui/rp_widget.h b/ui/rp_widget.h index 1d10351e6..5a5cc7b77 100644 --- a/ui/rp_widget.h +++ b/ui/rp_widget.h @@ -457,6 +457,16 @@ class RpWidget : public RpWidgetBase { 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;