Skip to content

The only downloader you need. 下载器的集大成者。

refactor(add_task_dialog): 优化窗口拖拽逻辑中的窗口引用方式

XiaoYouChR53f99101e664
diff --git a/app/view/components/add_task_dialog.py b/app/view/components/add_task_dialog.py
index 08489cf5..95717a83 100644
--- a/app/view/components/add_task_dialog.py
+++ b/app/view/components/add_task_dialog.py
@@ -421,14 +421,15 @@ class AddTaskDialog(MessageBoxBase):
self._dragPos = e.pos()
return True
elif e.type() == QEvent.Type.MouseMove and not self._dragPos.isNull():
- if self.isMaximized():
- self.window().showNormal()
+ window = self.window()
+ if window.isMaximized():
+ window.showNormal()
- pos = self.window().pos() + e.pos() - self._dragPos
+ pos = window.pos() + e.pos() - self._dragPos
pos.setX(max(0, pos.x()))
pos.setY(max(0, pos.y()))
- self.window().move(pos)
+ window.move(pos)
return True
elif e.type() == QEvent.Type.MouseButtonRelease:
self._dragPos = QPoint()