style: declare HoverableButton state attribute for the pyright gate

The dynamic _beamline_state assignment was a pre-existing pattern, but
the panel rewrite turned its line into a changed line, so the
basedpyright diff gate now counts it. Declare the attribute instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-11 10:35:46 +02:00
co-authored by Claude Fable 5
parent 3175e437a4
commit e818682abd
+4 -1
View File
@@ -63,8 +63,11 @@ class HoverableButton(QPushButton):
hovered = Signal(object)
unhovered = Signal()
# Set by the panel right after construction; carried in hover signals.
_beamline_state: BeamlineStateEnum | None = None
def enterEvent(self, event) -> None:
self.hovered.emit(getattr(self, "_beamline_state", None))
self.hovered.emit(self._beamline_state)
super().enterEvent(event)
def leaveEvent(self, event) -> None: