@@ -285,7 +285,7 @@ class ReverseYAxisTool(ToggleTool):
285285 def __init__ (self , manager : PlotManager ) -> None :
286286 super ().__init__ (manager , _ ("Reverse Y axis" ))
287287
288- def activate_command (self , plot : PlotManager , checked : bool ) -> None :
288+ def activate_command (self , plot : BasePlot , checked : bool ) -> None :
289289 """Triggers tool action.
290290
291291 Args:
@@ -295,7 +295,7 @@ def activate_command(self, plot: PlotManager, checked: bool) -> None:
295295 plot .set_axis_direction ("left" , checked )
296296 plot .replot ()
297297
298- def update_status (self , plot : PlotManager ) -> None :
298+ def update_status (self , plot : BasePlot ) -> None :
299299 """Update tool status if the plot type is not PlotType.CURVE.
300300
301301 Args:
@@ -346,7 +346,7 @@ def set_aspect_ratio_1_1(self) -> None:
346346 plot .set_aspect_ratio (ratio = 1 )
347347 plot .replot ()
348348
349- def activate_command (self , plot : PlotManager , checked : bool ) -> None :
349+ def activate_command (self , plot : BasePlot , checked : bool ) -> None :
350350 """Triggers tool action.
351351
352352 Args:
@@ -499,16 +499,16 @@ def activate_cmap(self, cmap: str | EditableColormap) -> None:
499499 self ._active_colormap = get_cmap (cmap )
500500 else :
501501 self ._active_colormap = cmap
502- plot = self .get_active_plot ()
502+ plot : BasePlot = self .get_active_plot ()
503503 if self ._active_colormap is not None and plot is not None :
504504 items = self .get_selected_images (plot )
505505 for item in items :
506506 item .param .colormap = self ._active_colormap .name
507507 item .param .update_item (item )
508+ plot .SIG_ITEM_PARAMETERS_CHANGED .emit (item )
508509 self .action .setText (_ ("Colormap: %s" ) % self ._active_colormap .name )
509510 plot .invalidate ()
510511 self .update_status (plot )
511- plot .SIG_ITEMS_CHANGED .emit (plot )
512512
513513 def update_status (self , plot : BasePlot ) -> None :
514514 """Update tool status if the plot type is not PlotType.CURVE.
@@ -825,7 +825,7 @@ def __init__(self, manager: PlotManager, toolbar_id=None) -> None:
825825 manager , title = _ ("Lock" ), icon = get_icon ("lock.png" ), toolbar_id = None
826826 )
827827
828- def activate_command (self , plot : PlotManager , checked : bool ) -> None :
828+ def activate_command (self , plot : BasePlot , checked : bool ) -> None :
829829 """Trigger tool action.
830830
831831 Args:
@@ -840,6 +840,7 @@ def activate_command(self, plot: PlotManager, checked: bool) -> None:
840840 item .setIcon (get_icon ("trimage_lock.png" ))
841841 else :
842842 item .setIcon (get_icon ("image.png" ))
843+ plot .SIG_ITEM_PARAMETERS_CHANGED .emit (item )
843844 plot .SIG_ITEMS_CHANGED .emit (plot )
844845
845846 def get_supported_items (self , plot : BasePlot ) -> list [IBasePlotItem | TrImageItem ]:
0 commit comments