mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
fix(image_widget): image_widget autorange fixed
This commit is contained in:
@ -66,7 +66,7 @@ class BECImageWidget(BECWidget, QWidget):
|
|||||||
"monitor": DeviceSelectionAction(
|
"monitor": DeviceSelectionAction(
|
||||||
"Monitor:", DeviceComboBox(device_filter="Device")
|
"Monitor:", DeviceComboBox(device_filter="Device")
|
||||||
),
|
),
|
||||||
"connect": IconAction(icon_path="connection.svg", tooltip="Connect Motors"),
|
"connect": IconAction(icon_path="connection.svg", tooltip="Connect Device"),
|
||||||
"separator_0": SeparatorAction(),
|
"separator_0": SeparatorAction(),
|
||||||
"save": IconAction(icon_path="save.svg", tooltip="Open Export Dialog"),
|
"save": IconAction(icon_path="save.svg", tooltip="Open Export Dialog"),
|
||||||
"separator_1": SeparatorAction(),
|
"separator_1": SeparatorAction(),
|
||||||
@ -382,8 +382,7 @@ class BECImageWidget(BECWidget, QWidget):
|
|||||||
"""
|
"""
|
||||||
Set the auto range of the plot widget from the toolbar.
|
Set the auto range of the plot widget from the toolbar.
|
||||||
"""
|
"""
|
||||||
checked = self.toolbar.widgets["auto_range"].action.isChecked()
|
self._image.set_auto_range(True, "xy")
|
||||||
self._image.set_auto_range(checked, "xy")
|
|
||||||
|
|
||||||
@SafeSlot()
|
@SafeSlot()
|
||||||
def toggle_fft(self):
|
def toggle_fft(self):
|
||||||
|
@ -83,8 +83,7 @@ def test_image_toolbar_rectangle_mode_action_triggered(image_widget, qtbot):
|
|||||||
def test_image_toolbar_auto_range(image_widget, mock_image):
|
def test_image_toolbar_auto_range(image_widget, mock_image):
|
||||||
action = image_widget.toolbar.widgets["auto_range"].action
|
action = image_widget.toolbar.widgets["auto_range"].action
|
||||||
action.trigger()
|
action.trigger()
|
||||||
assert action.isChecked() == False
|
image_widget._image.set_auto_range.assert_called_once_with(True, "xy")
|
||||||
image_widget._image.set_auto_range.assert_called_once_with(False, "xy")
|
|
||||||
|
|
||||||
|
|
||||||
def test_image_toolbar_enable_mouse_pan_mode(qtbot, image_widget):
|
def test_image_toolbar_enable_mouse_pan_mode(qtbot, image_widget):
|
||||||
|
Reference in New Issue
Block a user