elementary / granite

Library that extends GTK with common widgets and utilities
https://elementary.io
GNU Lesser General Public License v3.0
280 stars 61 forks source link

HeaderLabel: set accessible description #725

Closed danirabbit closed 2 months ago

danirabbit commented 2 months ago

Properly set secondary text as a description

danirabbit commented 2 months ago

@zeebok the labels themselves aren't actually available to the screen reader. So what happens is you have to set a mnemonic widget and then when that widget gets focus it reads out the accessible name, the type of widget, then the accessible description. So for example if the mnemonic widget was a text entry it would say:

"Username Text. Must be at least 8 characters long"

zeebok commented 2 months ago

Gotcha. Looking via the Inspector it has the secondary text as a different label that is a sibling of the primary and so each one has its own name in the accessibility data tab, so I wasn't sure if that is how it will appear with the screen reader

danirabbit commented 2 months ago

Oh hm yeah I'm not sure how the whole a11y tree stuff works, but I'll take a look at it!

danirabbit commented 2 months ago

I'm gonna go ahead and merge this for now since after double checking with Florian it seems the label order is correct here