The only downloader you need. 下载器的集大成者。
TypeScript asyncasynciobittorentbtcross-platformdownload-managerdownloaderfluent-designftphttp3magnetpyqtpyside6pythonqtquicreactsoftwarestreaming
修复 #138, 修复 Windows 10 下背景异常的问题
XiaoYouChR58d617b88c21
diff --git a/app/common/methods.py b/app/common/methods.pyindex b6284798..31947d2f 100644--- a/app/common/methods.py+++ b/app/common/methods.py@@ -28,9 +28,9 @@ plugins = []def isBorderAccentColorOpen():""" Check whether the border accent color is open """- from qframelesswindow.utils.win32_utils import isGreaterEqualWin10+ from qframelesswindow.utils.win32_utils import isGreaterEqualWin11- if not isGreaterEqualWin10():+ if not isGreaterEqualWin11():return Falsefrom winreg import OpenKey, HKEY_CURRENT_USER, KEY_READ, QueryValueEx, CloseKeydiff --git a/app/view/main_window.py b/app/view/main_window.pyindex 3ffc7a3e..2858357b 100644--- a/app/view/main_window.py+++ b/app/view/main_window.py@@ -5,13 +5,12 @@ from ctypes.wintypes import MSGfrom pathlib import Pathimport darkdetect-from PySide6.QtCore import QSize, QThread, Signal, QTimer, QPropertyAnimation, QRect, QUrl+from PySide6.QtCore import QSize, QThread, Signal, QTimer, QPropertyAnimation, QRect, QUrl, QOperatingSystemVersionfrom PySide6.QtGui import QIcon, QDragEnterEvent, QDropEvent, QKeySequence, QDesktopServices, QColorfrom PySide6.QtWidgets import QApplication, QGraphicsOpacityEffectfrom loguru import logger-from qfluentwidgets import FluentIcon as FIF, setTheme, Theme, themeColor+from qfluentwidgets import FluentIcon as FIF, setTheme, Theme, themeColor, isDarkThemefrom qfluentwidgets import NavigationItemPosition, MSFluentWindow, SplashScreen-from qframelesswindow.utils.win32_utils import isGreaterEqualWin10, isGreaterEqualWin8_1from .setting_interface import SettingInterfacefrom .task_interface import TaskInterface@@ -19,12 +18,21 @@ from ..common.config import cfg, Headers, attachmentTypes, FEEDBACK_URLfrom ..common.custom_socket import GhostDownloaderSocketServerfrom ..common.methods import getLinkInfo, bringWindowToTop, addDownloadTask, showMessageBox, isBorderAccentColorOpenfrom ..common.signal_bus import signalBus-from ..common.windows_window_effect import WindowsWindowEffectfrom ..components.add_task_dialog import AddTaskOptionDialogfrom ..components.custom_tray import CustomSystemTrayIconfrom ..components.update_dialog import checkUpdate+def isGreaterEqualWin10():+ """ determine if the Windows version ≥ Win10 """+ cv = QOperatingSystemVersion.current()+ return sys.platform == "win32" and cv.majorVersion() >= 10++def isLessThanWin10():+ """ determine if the Windows version < Win10"""+ cv = QOperatingSystemVersion.current()+ return sys.platform == "win32" and cv.majorVersion() < 10+class CustomSplashScreen(SplashScreen):def finish(self):@@ -56,6 +64,7 @@ class MainWindow(MSFluentWindow):# replace WindowsWindowEffectif isGreaterEqualWin10():+ from ..common.windows_window_effect import WindowsWindowEffectself.windowEffect = WindowsWindowEffect(self.winId())if isBorderAccentColorOpen():@@ -177,8 +186,6 @@ class MainWindow(MSFluentWindow):setTheme(Theme.DARK, save=False, lazy=True)if cfg.backgroundEffect.value in ['Mica', 'MicaBlur', 'MicaAlt']:QTimer.singleShot(500, self.applyBackgroundEffectByCfg)- # QTimer.singleShot(1000, self.applyBackgroundEffectByCfg)- # QTimer.singleShot(2000, self.applyBackgroundEffectByCfg)elif callback == 'Light':setTheme(Theme.LIGHT, save=False, lazy=True)@@ -186,6 +193,9 @@ class MainWindow(MSFluentWindow):self.applyBackgroundEffectByCfg()def _normalBackgroundColor(self):+ if self.styleSheet() == "":+ return self._darkBackgroundColor if isDarkTheme() else self._lightBackgroundColor+return QColor(0, 0, 0, 0)def applyBackgroundEffectByCfg(self):@@ -216,13 +226,13 @@ class MainWindow(MSFluentWindow):elif cfg.backgroundEffect.value == 'Aero':self.windowEffect.setAeroEffect(self.winId())self.setStyleSheet("background-color: transparent")- if not isGreaterEqualWin8_1():+ if isLessThanWin10():self.titleBar.closeBtn.hide()self.titleBar.minBtn.hide()self.titleBar.maxBtn.hide()elif cfg.backgroundEffect.value == 'None':self.setStyleSheet("")- if not isGreaterEqualWin8_1():+ if isLessThanWin10():self.titleBar.closeBtn.show()self.titleBar.minBtn.show()self.titleBar.maxBtn.show()