Shortcut Editor: Add 'Find' and 'Save' keyboard shortcuts #357
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
When using the Shortcut Editor (which is my new favourite thing 馃槃) I instinctively pressed "Ctrl+F" to focus the search bar. I figured it would be a useful bit of functionality, so I decided to add it!
While adding it, I also thought a save shortcut would be handy, so I added that too.
There is some precedent for keyboard shortcuts in ProtonUp-Qt, as we already have some on the Main Menu, so I think it's okay to add them to the Shortcut Editor too 馃檪
Implementation
These shortcuts are bound using
QKeySequence.Find
andQKeySequence.Save
, which are Qt's built-in per-platform "constants" (I guess?) for these actions. Since we're only targetting Linux with ProtonUp-Qt, it isn't a huge deal, but I think it's nicer to be explicit with a shortcut key combination called "Save" rather than the very, very slightly more ambiguous "Ctrl+S". This is also what we already use for the keyboard shortcuts on the Main Menu.To wire up the shortcuts:
searchBox
widget.btn_save_clicked
method.If this change is desired, there is room for other shortcuts too, such as
Ctrl+N
for creating a new shortcut row. Open to all discussion 馃槃Future Work
We could probably document these shortcuts on the brand-new wiki to give a bit more visibility on this change. We could have a page for keyboard shortcuts, with a per-screen table of available shortcuts. I'd be happy to take a stab at the markup and attach it to a discussion as I can't directly edit the wiki.
Thanks!