Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add listbox support #498

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add listbox support #498

wants to merge 3 commits into from

Conversation

DataTriny
Copy link
Member

Fixes #23

Adds support for list box controls on all supported platforms.

Known issues

VoiceOver only reports the selected items when the focus leaves the list box and if there is more than one child. I am not sure if this is the expected behavior for such controls. The accessibilityRows and accessibilitySelectedRows methods seem to never get called, but this might just be because of my very old macOS version.

Testing

These changes can be tested with this fork of Slint: cargo run -p _7guis --bin crud

The "Names" list view supports keyboard navigation: Up and Down arrows, PageUp, PageDown, Home and End keys, with the Control key modifier to move the focus but not the selection. However, multiple selections are not allowed. I think there are bugs in how the model syncs with the accessibility tree so adding or removing items usually put the application in an inconsistent state.

@mwcampbell
Copy link
Contributor

The code under consumer and platforms/windows looks good. But when I try to run the crud example from the slint fork, I get very intermittent speech feedback on Windows with NVDA. @DataTriny Have you tried that example on Windows?

@DataTriny
Copy link
Member Author

Windows 11 with NVDA is currently my setup for development so it is the combination I tested most extensively. Maybe what you are noticing is a short lag when moving the focus through the items. It happens with the Narrator as well. I haven't been able to find anything wrong for now so my current guess is that it is linked to the animation Slint plays when deselecting/selecting the items. The best proof of this is that it takes a bit of time for the AT to announce the first time an item gets the focus, but when you exit the list view and focus it back the focus change is immediately reported by the AT. I had a toy example before, only using winit, and I didn't notice this.

@DataTriny
Copy link
Member Author

I have set the duration of animations which apply to ListItem to 0ms (previously 150ms and 200ms) but I don't notice a real difference.

Instrumentation of the AccessKit codebase would really be helpful in such situation.

@mwcampbell
Copy link
Contributor

What I'm seeing is more severe. When I run the crud binary (a release build), also on Windows 11 with both NVDA and Narrator, there isn't even an announcement that the window is focused, though sometimes if I press Tab, it announces the window.

@DataTriny
Copy link
Member Author

This is something I have never experienced. I will only have access to a Windows 10 machine in the coming days, so I'm not sure if I'll be able to reproduce anything unfortunately.

@mwcampbell
Copy link
Contributor

Looks like a recent change in winit broke AccessKit on Windows. @DataTriny I suspect that if you update the Cargo.lock in your slint repo, you'll see it too. slint doesn't commit Cargo.lock to version control, so when I did a fresh clone of your fork, I got a new Cargo.lock file with the latest version of everything.

I guess we should open a new issue to track this.

@mwcampbell
Copy link
Contributor

I downgraded winit to 0.30.5 in my slint Cargo.lock, and now I can confirm that the listbox support looks good on Windows. Will look into macOS later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add UIA support for list boxes
2 participants