Feature/sidebar focus#1719
Conversation
Allows users to move keyboard focus directly to the projects sidebar using <Control><Alt>Left, improving accessibility and full keyboard navigation.
jeremypw
left a comment
There was a problem hiding this comment.
Unfortunately this does not seem to work yet - focus remains with the document for me. Not sure why yet, but it does work if you focus the choose_project_button instead. So its something to do with making sure the treeview within the SourceList gets (and retains) the final focus.
Also may need a matching hotkey to return focus to the document but that can be addressed later.
I notice that if you do focus the choose_project_button then you can reach other widgets in the headerbar by using the standard Tab and <Shift>Tab keys. But not the actionbar.
| construct { | ||
| orientation = Gtk.Orientation.VERTICAL; | ||
| get_style_context ().add_class (Gtk.STYLE_CLASS_SIDEBAR); | ||
| can_focus = true; |
There was a problem hiding this comment.
I am not sure this right - Sidebar is a container (Grid) which cannot have keyboard focus itself
0916dbb to
9f37b0e
Compare
|
@jeremypw Thanks for the detailed review and for pointing out the root cause! You are completely right. I have addressed the requested changes:-.
Regarding the shortcut to return focus to the document and the Actionbar tab navigation, I agree that those can be addressed in a separate follow-up PR as enhancements Thanks again! |
Summary
This PR fixes the keyboard accessibility issue where the project sidebar could not be focused via keyboard navigation.
Changes Made
Code.Sidebarfocusable by settingcan_focus = true.ACTION_FOCUS_SIDEBAR(action-focus-sidebar) toMainWindow.<Control><Alt>Leftto focus the sidebar directly (and opens it automatically if it is currently hidden).Fixes #1711