0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-13 19:21:50 +02:00

fix(plot_base): update mouse mode state on mode change

This commit is contained in:
2025-03-03 21:51:53 +01:00
parent 86487a5f4d
commit 1206069a8f

View File

@ -86,6 +86,7 @@ class MouseInteractionToolbarBundle(ToolbarBundle):
self.actions["switch_mouse"].actions["drag_mode"].action.setChecked(not checked)
if self.target_widget and checked:
self.target_widget.plot_item.getViewBox().setMouseMode(pg.ViewBox.RectMode)
self.mouse_mode = "RectMode"
@SafeSlot(bool)
def enable_mouse_pan_mode(self, checked: bool):
@ -98,6 +99,7 @@ class MouseInteractionToolbarBundle(ToolbarBundle):
self.actions["switch_mouse"].actions["rectangle_mode"].action.setChecked(not checked)
if self.target_widget and checked:
self.target_widget.plot_item.getViewBox().setMouseMode(pg.ViewBox.PanMode)
self.mouse_mode = "PanMode"
@SafeSlot()
def autorange_plot(self):