Applet configuration dialog: improve accessibility
This MR contains three a11y-related fixes for Plasma's applet configuration dialog:
- The Accessible.name and .description of the configuration pages in the sidebar are actually read out
- The Accessible.role of the sidebar and entries is changed to the more appropriate PageTab(List) instead of Menu(Bar/Item)
- The Apply and Cancel buttons are made reachable by keyboard/tab navigation.
Details in the commit messages below.
The ConfigCategoryDelegate sets Accessible.name, .role, and .description correctly and they are visible in Accerciser, but screen reader remains quiet when selecting them. This is because of the way focus is handled; the ScrollView handles selection of items itself and only sets the highlighted property of the delegate. As the delegate itself never receives focus, the screen reader does not understand that the selection has changed and that the new entry should be read out.
This change sets each delegate to take focus when its highlighted property is set. As it cannot actually do anything with it, the keyboard input it receives is passed upward to the ScrollView, which continues to handle it.
In configuration windows, a sidebar allows the user to select various subpages including the configuration pages, a keyboard shortcut, and the About page. The Accessible.role of the sidebar and entries is set to MenuBar and MenuItem, which is misleading as this does not function like a menu. Qt has a role that fits much better, namely PageTabList and PageTab "that the user can select to switch to a different page in a dialog." (QAccessible class).
This change sets the roles of the sidebar and entries to PageTabList and PageTab.
The OK button in the footer is set to pass focus to the sidebar on tab press, which means that Apply and Cancel cannot be reached with tab navigation, or any keyboard-based method except accelerators.
This change moves the point where focus is passed back to the sidebar on tab press to the final button, Cancel, making it and Apply reachable with keyboard navigation.