Skip to content

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

迫不得已通过 monkey_patch 修复 nuitka 编译后的闪退问题

XiaoYouChRb440ac94c741
diff --git a/Ghost-Downloader-3.py b/Ghost-Downloader-3.py
index 39c96a65..00ca5f89 100644
--- a/Ghost-Downloader-3.py
+++ b/Ghost-Downloader-3.py
@@ -7,6 +7,8 @@ from qfluentwidgets import qconfig
from app.common.application import SingletonApplication
from app.common.config import cfg
+# noinspection PyUnresolvedReferences
+from app.common import monkey_patch
# 设置程序运行路径, 便于调试
if not "__compiled__" in globals(): # 调试时候使用相对路径
diff --git a/app/common/monkey_patch.py b/app/common/monkey_patch.py
new file mode 100644
index 00000000..1569a09c
--- /dev/null
+++ b/app/common/monkey_patch.py
@@ -0,0 +1,13 @@
+from qfluentwidgets import ScrollBar
+
+def enterEvent(self, e):
+ self._isEnter = True
+ self.expand()
+
+def leaveEvent(self, e):
+ self._isEnter = False
+ self.timer.stop()
+ self.collapse()
+
+ScrollBar.enterEvent = enterEvent
+ScrollBar.leaveEvent = leaveEvent