The only downloader you need. 下载器的集大成者。
TypeScript asyncasynciobittorentbtcross-platformdownload-managerdownloaderfluent-designftphttp3magnetpyqtpyside6pythonqtquicreactsoftwarestreaming
Fixes #446
XiaoYouChRcb9748a48901
diff --git a/Ghost-Downloader-3.py b/Ghost-Downloader-3.pyindex f0679078..dc13d72c 100644--- a/Ghost-Downloader-3.py+++ b/Ghost-Downloader-3.py@@ -29,9 +29,9 @@ appLocalDataLocation = QStandardPaths.writableLocation(QStandardPaths.StandardLologger.add(f"{appLocalDataLocation}/GhostDownloader/GhostDownloader.log", rotation="512 KB", enqueue=True)sys.excepthook = exceptionHook-from qfluentwidgets import qconfig+from qfluentwidgets import qconfig, setThemefrom app.supports.application import SingletonApplication-from app.supports.config import VERSION, cfg+from app.supports.config import VERSION, cfg, toQFluentThemefrom app.supports.signal_bus import signalBus as exceptionSignalBuslogger.info(@@ -47,6 +47,8 @@ if cfg.get(cfg.dpiScale) != 0:os.environ["QT_SCALE_FACTOR"] = str(cfg.get(cfg.dpiScale))application = SingletonApplication(sys.argv, "gd3")+# Prime qfluentwidgets before widgets are constructed; its own default is light.+setTheme(toQFluentTheme(cfg.customThemeMode.value), save=False)# --- Start Program ---import warningsdiff --git a/app/supports/config.py b/app/supports/config.pyindex c46bb975..9c053885 100644--- a/app/supports/config.py+++ b/app/supports/config.py@@ -17,6 +17,7 @@ from qfluentwidgets import (ConfigValidator,ConfigSerializer,FolderListValidator,+ Theme,)DEFAULT_HEADERS = {@@ -152,6 +153,13 @@ class HeadersSerializer(ConfigSerializer):return DEFAULT_HEADERS+def toQFluentTheme(value: str) -> Theme:+ return {+ "Dark": Theme.DARK,+ "Light": Theme.LIGHT,+ }.get(value, Theme.AUTO)++class Config(QConfig):# 总下载设置diff --git a/app/view/windows/main_window.py b/app/view/windows/main_window.pyindex 8d30cead..468b43f1 100644--- a/app/view/windows/main_window.py+++ b/app/view/windows/main_window.py@@ -10,13 +10,13 @@ from PySide6.QtGui import QDesktopServices, QIcon, QColor, QPalettefrom PySide6.QtWidgets import QApplication, QGraphicsOpacityEffect, QDialogfrom loguru import loggerfrom qfluentwidgets import MSFluentWindow, SplashScreen, FluentIcon, NavigationItemPosition, InfoBar, InfoBarPosition, \- PushButton, PrimaryPushButton, setTheme, Theme, isDarkTheme, setThemeColor+ PushButton, PrimaryPushButton, setTheme, isDarkTheme, setThemeColorfrom app.services.browser_service import BrowserServicefrom app.services.core_service import coreServicefrom app.services.feature_service import featureServicefrom app.supports.config import cfg, DEFAULT_HEADERS, AUTHOR_URL, VERSION, FEEDBACK_URL, GD3_COPY_MIME_TYPE, isWin10, \- isLessThanWin10+ isLessThanWin10, toQFluentThemefrom app.supports.recorder import taskRecorderfrom app.supports.signal_bus import signalBusfrom app.supports.update import bestAsset, fetchRelease, isOutdated, toVersion@@ -69,7 +69,8 @@ class MainWindow(MSFluentWindow):self.connectSignalToSlot()self._syncClipboardListener()- self._toggleTheme(cfg.customThemeMode.value, triggeredByUser=True)+ if platform == 'win32':+ self._applyBackgroundEffectByCfg(cfg.backgroundEffect.value)self.syncThemeColor()if cfg.checkUpdateAtStartUp.value:@@ -155,12 +156,7 @@ class MainWindow(MSFluentWindow):value: "Literal['System', 'Dark', 'Light']",triggeredByUser: bool = False,):- if value == 'Dark':- setTheme(Theme.DARK, save=False)- elif value == 'Light':- setTheme(Theme.LIGHT, save=False)- else:- setTheme(Theme.AUTO, save=False)+ setTheme(toQFluentTheme(value), save=False)IconBodyLabel.clearCache()