style: narrow the manual-resize press state for the pyright gate

The diff-vs-main basedpyright gate flags QRect(self._press_geom) because
only _press_global was narrowed; both are set together in
mousePressEvent, so the extra check is a no-op at runtime.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
duan_jandClaude Fable 5 committed 2026-08-11 10:35:55 +02:00
1 parent 27c9b93d5c
commit 763a25837c
1 file changed
+3 -1
+3 -1
View File
@@ -196,7 +196,9 @@ class PopoutWindow(QWidget):
super().mousePressEvent(event)
def mouseMoveEvent(self, event):
if self._manual_edges and self._press_global is not None:
# Both press fields are set together in mousePressEvent; the second
# check exists for the pyright gate, which can't see that pairing.
if self._manual_edges and self._press_global is not None and self._press_geom is not None:
delta = event.globalPosition().toPoint() - self._press_global
geom = QRect(self._press_geom)
if self._manual_edges & Qt.Edge.LeftEdge: