feat(PlotItem) define context menu action visibility#2584
feat(PlotItem) define context menu action visibility#2584j9ac9k merged 2 commits intopyqtgraph:masterfrom
Conversation
|
Hi @jmkerloch Thanks for the PR; this feature request has come up a few times, so I really appreciate the PR to implement this. One nit-pick I have is to switch to a numpy doc style docstring; you can see another example in PlotItem here: https://github.com/pyqtgraph/pyqtgraph/blob/master/pyqtgraph/graphicsItems/PlotItem/PlotItem.py#L1179C2-L1203 Also, how do you feel about accepting I'm not sold on the method name, but I can't think of anything better, @outofculture @ixjlyons either of you two think of a better name here (or have other comments?) |
|
@j9ac9k I updated the docstring. It seems OK to me in the generated documentation. |
|
Thanks @jmkerloch This PR looks good to me, we appreciate your contribution! |
Add method
setContextMenuActionVisibleinPlotItem.Based on action
name('Transforms', 'Downsample', 'Average', 'Alpha', 'Grid', 'Points'), action is set visible depending on the argumentvisibleTo avoid issue with translation (action text is translated) action name is translated to get correction action.
Fixes #2351