spacr.qt.widgets.ai_toggle_label

AiToggleLabel — a clickable text label used in place of a QCheckBox for the “AI” switch that sits at the bottom-right of every AppScreen.

  • Reads “AI” in white when off.

  • Reads “AI” in the accent blue when on.

  • Emits toggled(bool) on click; also exposes a QCheckBox-compatible isChecked() / setChecked() API so the AppScreen doesn’t care which widget it’s talking to.

Module Contents

class spacr.qt.widgets.ai_toggle_label.AiToggleLabel(parent=None)[source]

Bases: PySide6.QtWidgets.QLabel

Clickable “AI” text label that behaves like a QCheckBox toggle.

Variables:

toggled – emitted with the new on/off state whenever the user clicks or setChecked() flips the state.

toggled[source]
isChecked() bool[source]

Return True when the AI toggle is currently ON.

setChecked(on: bool) None[source]

Set the toggle state; emits toggled only on a real change.

mousePressEvent(event)[source]

Flip the toggle on left-click; forward other buttons to Qt.