|
1 | 1 | #/*########################################################################## |
2 | | -# Copyright (C) 2004-2022 European Synchrotron Radiation Facility |
| 2 | +# Copyright (C) 2004-2025 European Synchrotron Radiation Facility |
3 | 3 | # |
4 | 4 | # This file is part of the PyMca X-ray Fluorescence Toolkit developed at |
5 | 5 | # the ESRF. |
@@ -94,36 +94,21 @@ class Plot1DViewWithPlugins(DataViews._Plot1dView): |
94 | 94 | def createWidget(self, parent): |
95 | 95 | return Plot1DWithPlugins(parent=parent) |
96 | 96 |
|
97 | | - |
98 | | -class Plot2DWithPlugins(Plot2D): |
99 | | - """Add a plugin toolbutton to a Plot2D""" |
100 | | - def __init__(self, parent=None): |
101 | | - Plot2D.__init__(self, parent) |
102 | | - |
103 | | - self._toolbar = qt.QToolBar(self) |
104 | | - self.addToolBar(self._toolbar) |
105 | | - pluginsToolButton = PluginsToolButton(plot=self, parent=self, |
| 97 | +class Plot2DViewWithPlugins(DataViews._Plot2dView): |
| 98 | + def createWidget(self, parent): |
| 99 | + widget = super().createWidget(parent) |
| 100 | + widget.setKeepDataAspectRatio(False) |
| 101 | + pymcaToolbar = qt.QToolBar(widget) |
| 102 | + widget.addToolBar(pymcaToolbar) |
| 103 | + pluginsToolButton = PluginsToolButton(plot=widget, parent=widget, |
106 | 104 | method="getPlugin2DInstance") |
107 | 105 |
|
108 | 106 | if PLUGINS_DIR: |
109 | 107 | pluginsToolButton.getPlugins( |
110 | 108 | method="getPlugin2DInstance", |
111 | 109 | directoryList=PLUGINS_DIR) |
112 | | - self._toolbar.addWidget(pluginsToolButton) |
113 | | - if hasattr(self, "getIntensityHistogramAction"): |
114 | | - self.getIntensityHistogramAction().setVisible(True) |
115 | | - else: |
116 | | - print("Plot2D getIntensityHistogramAction missing") |
117 | | - |
118 | | - |
119 | | -class Plot2DViewWithPlugins(DataViews._Plot2dView): |
120 | | - def createWidget(self, parent): |
121 | | - widget = Plot2DWithPlugins(parent=parent) |
122 | | - widget.setDefaultColormap(self.defaultColormap()) |
123 | | - widget.getColormapAction().setColorDialog(self.defaultColorDialog()) |
124 | | - widget.setKeepDataAspectRatio(False) |
125 | | - widget.getXAxis().setLabel('X') |
126 | | - widget.getYAxis().setLabel('Y') |
| 110 | + pymcaToolbar.addWidget(pluginsToolButton) |
| 111 | + widget.getIntensityHistogramAction().setVisible(True) |
127 | 112 | return widget |
128 | 113 |
|
129 | 114 | class ArrayCurvePlotWithPlugins(NXdataWidgets.ArrayCurvePlot): |
|
0 commit comments