The only downloader you need. 下载器的集大成者。
TypeScript asyncasynciobittorentbtcross-platformdownload-managerdownloaderfluent-designftphttp3magnetpyqtpyside6pythonqtquicreactsoftwarestreaming
feat(theme): 实现自定义主题模式支持
XiaoYouChR26bc27397600
diff --git a/Ghost-Downloader-3.py b/Ghost-Downloader-3.pyindex 93cae287..159d0175 100644--- a/Ghost-Downloader-3.py+++ b/Ghost-Downloader-3.py@@ -1,8 +1,5 @@-import sysimport os--# import orjson-# sys.modules['json'] = orjson+import sysfrom PySide6.QtCore import QStandardPaths@@ -11,8 +8,10 @@ from qfluentwidgets import qconfigfrom app.supports.application import SingletonApplicationfrom app.supports.config import cfg-appLocalDataLocation = QStandardPaths.writableLocation(QStandardPaths.StandardLocation.AppLocalDataLocation)+# import orjson+# sys.modules['json'] = orjson+appLocalDataLocation = QStandardPaths.writableLocation(QStandardPaths.StandardLocation.AppLocalDataLocation)qconfig.load(f"{appLocalDataLocation}/GhostDownloader/UserConfig.json", cfg)if cfg.get(cfg.dpiScale) != 0:@@ -25,6 +24,10 @@ application = SingletonApplication(sys.argv, "gd3")from loguru import loggerimport timeimport warnings+from getpass import getuser+from qfluentwidgets import setThemeColor, setTheme, Theme+from qframelesswindow.utils import getSystemAccentColor+from PySide6.QtGui import QColorfrom app.supports.config import VERSIONfrom app.view.windows.main_window import MainWindow@@ -33,14 +36,35 @@ from app.supports.recorder import taskRecorderimport app.assets.resourcesfrom app.services.core_service import coreServicefrom app.services.feature_service import featureService-from niquests.packages import urllib3logger.add(f"{appLocalDataLocation}/GhostDownloader/GhostDownloader.log", rotation="512 KB", enqueue=True)logger.info(f"Ghost Downloader v{VERSION} is Launched at {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))}")-urllib3.disable_warnings()warnings.warn = logger.warning+if cfg.customThemeMode.value == "System":+ setTheme(Theme.AUTO, save=False)+elif cfg.customThemeMode.value == "Light":+ setTheme(Theme.LIGHT, save=False)+else:+ setTheme(Theme.DARK, save=False)++if sys.platform in {"win32", "darwin"}:+ print(getSystemAccentColor())+ setThemeColor(getSystemAccentColor(), save=False)+if sys.platform == "linux":++ if 'KDE_SESSION_UID' in os.environ: # KDE Plasma++ import configparser+ config = configparser.ConfigParser()++ config.read(f"/home/{getuser()}/.config/kdeglobals")++ if 'Colors:Window' in config:+ color = list(map(int, config.get('Colors:Window', 'DecorationFocus').split(",")))+ setThemeColor(QColor(*color))+isSilently = "silent" in sys.argvcoreService.start()mainWindow = MainWindow(isSilently)