Report the position of a painted list item within its set - #359
Open
rezabakhshilaktasaraei wants to merge 1 commit into
Open
Report the position of a painted list item within its set#359rezabakhshilaktasaraei wants to merge 1 commit into
rezabakhshilaktasaraei wants to merge 1 commit into
Conversation
A painted list item reports its "x of y" through the accessibility attributes interface as PositionInSet / SizeOfSet, which the Windows UIA bridge maps to the properties a screen reader announces as "2 of 10". The numbers come from the owner through accessibilityChildSetPosition(): by default every child is one of the set, a list with rows that are not items (a divider between them) overrides it to leave them out - such a row exposes no position at all. The two attributes are in Qt since 6.13; the Qt 5.15 and 6.11 builds get them through the desktop-app/patches backports.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A painted list item had no way to tell a screen reader which of how many rows it is, so the lists that are real widgets say "2 of 10" while the painted ones stay silent about it.
Item reports it now through the accessibility attributes interface, as the PositionInSet / SizeOfSet attributes the Windows UIA bridge maps to the properties a screen reader announces. The numbers come from the owner through accessibilityChildSetPosition(): by default every child is one of the set (index + 1 of the child count), and a list with rows that are not items - a divider between them - overrides it to leave those out, so they neither get a position nor shift the ones below. A row outside the set does not expose the interface at all.
The two attributes are in Qt since 6.13 (https://codereview.qt-project.org/c/qt/qtbase/+/764810), so the Qt 5.15 and 6.11.1 builds need desktop-app/patches#265 to compile.
Used by telegramdesktop/tdesktop#31218 for the message lists. Verified with NVDA on Windows 10: the chat list, the folder tabs, the countries and languages lists and the message lists all announce "n of N" after the row name.