-
Notifications
You must be signed in to change notification settings - Fork 54
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
base: main
Are you sure you want to change the base?
Add listbox support #498
Conversation
The code under |
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. |
I have set the duration of animations which apply to Instrumentation of the AccessKit codebase would really be helpful in such situation. |
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. |
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. |
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. |
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. |
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
andaccessibilitySelectedRows
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.