cbrnr / mnelab

MNELAB – a GUI for MNE
BSD 3-Clause "New" or "Revised" License
239 stars 69 forks source link

WIP,ENH: sidebar context menu #342

Open GuillaumeFavelier opened 2 years ago

GuillaumeFavelier commented 2 years ago

This PR shows a basic context menu when the user right-clicks on an element of the sidebar. It's another take on the suggestion described in https://github.com/cbrnr/mnelab/issues/305. Plus other useful actions could eventually be added to the context menu:

https://user-images.githubusercontent.com/18143289/161091797-35826969-5a28-4fb1-936a-d11e9ffbecc7.mp4

cbrnr commented 2 years ago

This is useful! Can you make it so that the context menu only appears when the mouse is over an actual entry? Right now you can click anywhere in the sidebar.

Also, closing a file would be a good candidate for a dedicated "X" (e.g. right-aligned next to the sidebar entry), which I'd prefer over a context menu entry. But if this is too difficult, having it in the context menu is certainly better than nothing.

GuillaumeFavelier commented 2 years ago

Can you make it so that the context menu only appears when the mouse is over an actual entry?

I'll see if I can make it work like that. Otherwise, I'll try to add the right-aligned 'X' close button.

cbrnr commented 9 months ago

@GuillaumeFavelier do you want to continue working on this? We can skip the X button and only have a context menu, but it should only appear when right-clicking on an item. The menu could include two entries "Rename" and "Close" for now.