Skip to content

Commit

Permalink
Ensure focus mode is disabled after calibration
Browse files Browse the repository at this point in the history
There were a few situations where focus mode was still enabled after
calibration. This is very bad, as the users cannot interact with the
GUI anymore if focus mode is enabled.

Ensure focus mode is disabled after calibration.

Fixes: #1556

Signed-off-by: Patrick Avery <[email protected]>
  • Loading branch information
psavery committed Aug 5, 2023
1 parent b85af6e commit 0aac96a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion hexrd/ui/calibration/calibration_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@ def run_calibration(self):
# In case any overlays changed
HexrdConfig().overlay_config_changed.emit()
HexrdConfig().update_overlay_editor.emit()

# Focus mode should definitely not be enabled at this point,
# but let's be extra careful and make sure it is disabled.
self.enable_focus_mode(False)

self.finished.emit()

def write_instrument_to_hexrd_config(self, instr):
Expand Down Expand Up @@ -648,8 +653,9 @@ def disable_line_picker(self, b=True):
if self.line_picker:
self.line_picker.disabled = b
self.line_picker.ui.setVisible(not b)

# Make sure focus mode is enabled while the line picker is visible
self.enable_focus_mode(True)
self.enable_focus_mode(not b)

def enable_line_picker(self):
self.disable_line_picker(False)
Expand Down

0 comments on commit 0aac96a

Please sign in to comment.