style: format with ruff
This commit is contained in:
@@ -269,18 +269,18 @@ class TutorialOverlay(QWidget):
|
||||
bubble_y = margin + 48
|
||||
|
||||
bubble_x = min(
|
||||
max(margin, bubble_x),
|
||||
max(margin, self.width() - self.callout.width() - margin),
|
||||
max(margin, bubble_x), max(margin, self.width() - self.callout.width() - margin)
|
||||
)
|
||||
bubble_y = min(
|
||||
max(margin, bubble_y),
|
||||
max(margin, self.height() - self.callout.height() - margin - 60),
|
||||
max(margin, bubble_y), max(margin, self.height() - self.callout.height() - margin - 60)
|
||||
)
|
||||
|
||||
self.callout.move(bubble_x, bubble_y)
|
||||
|
||||
def _reposition_action_buttons(self) -> None:
|
||||
buttons = [btn for btn in (self.back_button, self.skip_button, self.next_button) if btn.isVisible()]
|
||||
buttons = [
|
||||
btn for btn in (self.back_button, self.skip_button, self.next_button) if btn.isVisible()
|
||||
]
|
||||
if not buttons:
|
||||
return
|
||||
|
||||
@@ -386,10 +386,7 @@ class TutorialManager(QObject):
|
||||
self.stop()
|
||||
|
||||
self.current_scenario = scenario
|
||||
self.context = TutorialContext(
|
||||
scenario_id=scenario.id,
|
||||
language=language,
|
||||
)
|
||||
self.context = TutorialContext(scenario_id=scenario.id, language=language)
|
||||
self.runtime_state = build_runtime_state_for_scenario(scenario)
|
||||
self.runtime_state.started_at_ms = _now_ms()
|
||||
self.runtime_state.active_step_index = -1
|
||||
@@ -429,7 +426,7 @@ class TutorialManager(QObject):
|
||||
self.tutorial_stopped.emit(scenario_id)
|
||||
|
||||
def emit_event(self, name: str, payload: dict[str, Any] | None = None) -> TutorialEvent:
|
||||
event = self.event_bus.emit_event(name, payload or {});
|
||||
event = self.event_bus.emit_event(name, payload or {})
|
||||
if self.context is not None:
|
||||
self.context.event_log.append(event)
|
||||
return event
|
||||
@@ -622,9 +619,7 @@ class TutorialManager(QObject):
|
||||
return False
|
||||
|
||||
return self.completion_evaluator.is_step_complete(
|
||||
step,
|
||||
self.context,
|
||||
target_clicked=target_clicked,
|
||||
step, self.context, target_clicked=target_clicked
|
||||
)
|
||||
|
||||
def _try_auto_advance_current_step(self, *, target_clicked: bool = False) -> None:
|
||||
@@ -690,9 +685,13 @@ class TutorialManager(QObject):
|
||||
|
||||
self._mark_current_step_failed("Step timed out.")
|
||||
|
||||
if step.skippable and self.current_scenario is not None and self.current_scenario.allow_skip:
|
||||
if (
|
||||
step.skippable
|
||||
and self.current_scenario is not None
|
||||
and self.current_scenario.allow_skip
|
||||
):
|
||||
if self.runtime_state is not None:
|
||||
self._advance_to_index(self.runtime_state.active_step_index + 1)
|
||||
return
|
||||
|
||||
self.overlay.next_button.setEnabled(True)
|
||||
self.overlay.next_button.setEnabled(True)
|
||||
|
||||
Reference in New Issue
Block a user