Skip to content

Commit eea8cc0

Browse files
Robert0MartRoberto
andauthored
Bugfix/nozzle calli hide (#189)
* Bugfix: hide screen when not active * Refactor : optimzied code --------- Co-authored-by: Roberto <roberto.martins@blockstec.com>
1 parent 2d9d96e commit eea8cc0

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

BlocksScreen/lib/panels/widgets/probeHelperPage.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -524,14 +524,18 @@ def on_manual_probe_update(self, update: dict) -> None:
524524

525525
# if update.get("z_position_lower"):
526526
# f"{update.get('z_position_lower'):.4f} mm"
527-
if update.get("is_active"):
528-
if not self.isVisible():
529-
self.request_page_view.emit()
530-
531-
self.helper_initialize = False
532-
self.helper_start = True
527+
is_active = update.get("is_active", False)
528+
if is_active and not self.isVisible():
529+
self.request_page_view.emit()
530+
# Shared state updates
531+
self.helper_initialize = False
532+
self.helper_start = is_active
533+
# UI updates
534+
self._toggle_tool_buttons(is_active)
535+
if is_active:
533536
self._hide_option_cards()
534-
self._toggle_tool_buttons(True)
537+
else:
538+
self._show_option_cards()
535539

536540
if update.get("z_position_upper"):
537541
self.old_offset_info.setText(f"{update.get('z_position_upper'):.4f} mm")

0 commit comments

Comments
 (0)