spyder-ide / ux-improvements

Discussion about UX improvements for Spyder 5 and beyond
4 stars 2 forks source link

keyboard-shortcuts to toggle panes #46

Open raphaelquast opened 3 years ago

raphaelquast commented 3 years ago

Issue Report Checklist

Problem Description

... not a problem... a feature request πŸ™‚

Right now, the keyboard-shortcuts crtl + shift + ( O, F etc.) can be used to "show" or "switch-to" the individual panes ("outline", "find", etc.)

I think it would be very nice if there are additional shortcuts (how about alt + shift + (O, F etc.) ) that allow to toggle (e.g. show or hide) the corresponding panels!

a quick use-case might be:

  • I usually have the outline to the left of my window, the editor in the middle and a split of console + help on the right.
    • now most of the time I don't actually need to see the outline, but right now i can only close the panel by explicitly selecting it and then pressing crtl + shift + F4 (or closing it with the mouse) ... a single shortcut to toggle the outline would be really helpful!
steff456 commented 3 years ago

Hi @raphaelquast,

This is a very good idea! Right now I'm going to move this issue to the ux repository were we are discussing all the new feature requests with the whole team. This feature request is going to be in the low priority list for us for now, so I encourage you to contribute to the project with this idea. We can give all the guidance you need.

Thanks for reporting!

raphaelquast commented 3 years ago

hey, even though I know my way around python, I doubt that i find the time to implement this myself.... nevertheless, can you point me to the right direction (e.g. the files where your shortcuts are implemented) so that in case I get motivated I can have a look?

steff456 commented 3 years ago

Hi @raphaelquast,

Sure I can encourage you to contribute with this feature! First, please go to the contributing guide (https://github.com/spyder-ide/spyder/blob/master/CONTRIBUTING.md) to set up your environment, in case you prefer to follow a video I can also link it here: https://www.youtube.com/watch?v=GizipMT1LvQ

Once you can run Spyder using python bootstrap.py you will be able to start making changes and test them in the development mode.

For this particular enhancement, you will need to make changes in the base of Spyder's plugin API. In particular, you will need to add an action in the file spyder/api/widgets/main_widget.py beneath the definition of self.toggle_view_action in line 352. The definition is going to be pretty similar to self.toggle_view_action, but in the name it will be called "hide " + self._name and the action performed will be linked to close the plugin.

After this, you will be able to do changes under the file spyder/config/main.py in the dictionary where the key is shortcuts. In there you will need to define the new shortcuts for hiding all the panes as is the case right now for all the "switch to X".

Hope this helps you to start your first PR and if I can help you in something else please let me know.

raphaelquast commented 3 years ago

@steff456 thanks! yep that looks like all I need to get this thing done... now all that's left to find is a bit of time to actually do it πŸ˜„ I'll let you know once I found some time to have a look!