slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.67k stars 611 forks source link

Add set-related accessible properties #6667

Closed DataTriny closed 3 weeks ago

DataTriny commented 4 weeks ago

These two properties aren't yet implemented by AccessKit's platform adapters but I have tested that they indeed work as expected on my work-in-progress branch to add listbox support to AccessKit.

They allow assistive technologies to provide hints to users about where they are inside group widgets, to quickly tell how many choices are available (radio buttons) or their location in a potentially large list (list views, equivalent to the visual indication given by the scroll bar). They are especially useful if not elements are currently present in the tree. They correspond to ARIA's aria-posinset and aria-setsize properties.

Changelog: Add accessible-position-in-set and accessible-size-of-set properties

tronical commented 4 weeks ago

Looks good. How strong do you feel about the indexing starting at 1 instead of 0?

DataTriny commented 4 weeks ago

As long as it is well documented, I don't think I have an issue with making it zero-based. Since zero-based indices probably feel more logical to developers, I wonder if we should update the position_in_set property on our side. @mwcampbell?

mwcampbell commented 3 weeks ago

I have no problem with making it 0-based. For a usize property, that also makes an illegal state unrepresentable.

DataTriny commented 3 weeks ago

@tronical We'll apply the offset on our end.