Add focus sidebar action to window
Fixes #51
Possible solution to allow users access to the sidebar without resorting to the mouse by pressing <Ctrl>Left. Note that the sidebar can already be unfocused with the shortcut <Ctrl>Right.
A possible alternative, or additional, solution would be to have a "Rename currently focused bookmark" action with an accelerator such as <Ctrl>F2.
While the code seems good, when I test on an OS8 vm it does not seem to move focus to the sidebar.
@zeebok Thanks for looking at this! I'll look at it again now I am working on OS8 Wayland.
@zeebok Just tested under Wayland and X on OS8 and it works for me. It did stop working after a system update but reinstalling the branch fixed that. Maybe something to do with the vm or maybe that key combination is used for something else on your system?
It is an open question whether we should also facilitate focusing the Storage listbox. After this PR is merged (which only focuses the Bookmark list) the Storage list can be focused by pressing Tab (<Shift>Tab to go the other way) but this is not so obvious.
~I don't think this solves #51. I feel like OP is right that the current focus behavior is just weird. Gonna comment on the original issue~
Hm actually I'm not sure how to solve this really. It feels weird in general but I don't know what the solution is right now.
@danirabbit I agree it is hard to find a good solution for the case where a user is using both mouse/touch and keyboard.
Maybe the focus should not switch to the view when a bookmark is activated with the keyboard? But that still does not fix #51. I do not that think that issue is really fixable since we do not know when a user clicks on a bookmark what it is that they intend to do next.
Either way, I imagine a keyboard (only) user would appreciate a convenient way of focusing the bookmarks that works whatever else is focused. Not sure what to do about focusing the storage or network entries though.
Hm actually I'm not sure how to solve this really. It feels weird in general but I don't know what the solution is right now.
Since clicking on a bookmark causes no item to be selected, can we leverage that to have the rename action move to the last click item, in this case the bookmark?
@zeebok This is a possibility, provided that as soon as a directory view item is selected then the rename action acts on that. It would still be not possible to rename the bookmark using the keyboard once the view has been used. The only solution for that (other than this one) would be to have a different shortcut for renaming bookmarks. It is a bit weird to have the same shortcut for two different actions anyway.
It would still be no possible to rename the bookmark using the keyboard once the view has been used.
I think this would probably be fine, given the context of actions that have happened. Might be worth asking the issuer what they think since it is a scenario they are in more than we are?
It is a bit weird to have the same shortcut for two different actions anyway.
Totally agree, this is a very weird problem to solve hahaha
Is there anything about this that blocks merging (even if it is not a full or ideal solution for the renaming issue)? As we already have <Ctrl>Right to move focus from sidebar to view a matching shortcut to move focus the other way seems logical.
I don't think!
@danirabbit Are you OK for this to be merged, at least pro tem? I'll fix the mentioned <Ctrl><Right> issue separately as it is outside the scope of this PR.